铁鞋上传的数据:
铁鞋的ID号 (Byte0) |
状态字 (Byte1) |
距离数据 (Byte2) |
电量数据 (Byte3) |
震动数据 (Byte4) |
1个字节, 范围为0x01~0xFF |
高四位为命令字,0x10表示正常的地磁数据上传;低四位为状态字,0x01表示无车,0x02表示有车。 |
1个字节的距离数据,0x01~0Xff,单位CM |
1个字节的电量数据,如0x32表示电池电压3.2V |
1个字节的震动数据,如0x01震动,0x00正常。 |
保留 (Byte5) |
RSSI值 (Byte6) |
|||
2个字节 |
1个字节的RSSI值 |
根据铁鞋数据,设计铁鞋类
public class Shoes { private string shoesID; public string ShoesID { get { return shoesID; } set { shoesID = value; } }
private string shoesName; public string ShoesName { get { return shoesName; } set { shoesName = value; } } private double distance; public double Distance { get { return distance; } set { distance = value; } } private int state; public int State { get { return state; } set { state = value; } } private int battery; public int Battery { get { return battery; } set { battery = value; } } private int isShake; public int IsShake { get { return isShake; } set { isShake = value; } } private double rssi; public double Rssi { get { return rssi; } set { rssi = value; } } private string other; public string Other { get { return other; } set { other = value; } } private int onoff; public int Onoff { get { return onoff; } set { onoff = value; } } }
设置非智能铁鞋类数据结构
class TraditionalShoes { private string tradiShoesName; private int tradiShoesState; public string TradiShoesName { get { return tradiShoesName; } set { tradiShoesName = value; } } public int TradiShoesState { get { return tradiShoesState; } set { tradiShoesState = value; } } }
设置紧固器类
class Tightener { private string name; private int state; public string Name { get { return name; } set { name = value; } } public int State { get { return state; } set { state = value; } } }
设置股道类
考虑股道点位设置铁鞋的两种类型:1,单边 ;2,双边;
所停车辆的位置,分为3个点位,从上行到下行方向,依次为:A1、A2\B1、B2\C1、C2车位;
所包含的信息有:股道号、是否显示、智能铁鞋信息、传统铁鞋信息、紧固器信息、股道状态
public class Track { public struct Position { int trackIsDisplay; Shoes positionShoes; TraditionalShoes positionTradiShoes; Tightener positionTightener; }
int trackState; private int trackNum; private Position a1; private Position a2; private Position a3; private Position a4; private Position b1; private Position b2; private Position b3; private Position b4; private Position c1; private Position c2; private Position c3; private Position c4; public int TrackNum { get { return trackNum; } set { trackNum = value; } } public Position A1 { get { return a1; } set { a1 = value; } } public Position A2 { get { return a2; } set { a2 = value; } } public Position A3 { get { return a3; } set { a3 = value; } } public Position A4 { get { return a4; } set { a4 = value; } } public Position B1 { get { return b1; } set { b1 = value; } } public Position B2 { get { return b2; } set { b2 = value; } } public Position B3 { get { return b3; } set { b3 = value; } } public Position B4 { get { return b4; } set { b4 = value; } } public Position C1 { get { return c1; } set { c1 = value; } } public Position C2 { get { return c2; } set { c2 = value; } } public Position C3 { get { return c3; } set { c3 = value; } } public Position C4 { get { return c4; } set { c4 = value; } } }