加ant+相关代码。
This commit is contained in:
1 parent
f45711f39f
commit
3c2bb10f07
115 files changed
+9058
-405
No files matched your search
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Devices.Ant.Messages
|
||||
{
|
||||
public class FecUserConfiguration : BaseMessage
|
||||
{
|
||||
private readonly int _weight;
|
||||
|
||||
public FecUserConfiguration(byte channel, double weight)
|
||||
: base(channel)
|
||||
{
|
||||
this._weight = (int)(weight * 100.0);
|
||||
}
|
||||
|
||||
public override ANTMessage GetMessage()
|
||||
{
|
||||
return new ANTMessage()
|
||||
{
|
||||
Id = (byte)79,
|
||||
Size = (byte)4,
|
||||
Data = new byte[9]
|
||||
{
|
||||
this.Channel,
|
||||
(byte) 55,
|
||||
(byte) (this._weight & (int) byte.MaxValue),
|
||||
(byte) (this._weight >> 8 & (int) byte.MaxValue),
|
||||
byte.MaxValue,
|
||||
(byte) 143,
|
||||
(byte) 12,
|
||||
(byte) 70,
|
||||
(byte) 0
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user