43 lines
1.0 KiB
Plaintext
43 lines
1.0 KiB
Plaintext
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace SN_Server.ServerMSGS
|
|
{
|
|
public class SM_UnitList
|
|
{
|
|
private ServerMSG _sm;
|
|
public Unit unit;
|
|
|
|
public SM_UnitList(ServerMSG sm)
|
|
{
|
|
_sm = sm;
|
|
unit = new Unit();
|
|
DecodePayload(sm.Payload);
|
|
}
|
|
|
|
private void DecodePayload(string paylaod)
|
|
{
|
|
string[] temp = paylaod.Split(':');
|
|
unit.DBid = Convert.ToInt32(temp[0]);
|
|
|
|
unit.RadioID = temp[1];
|
|
|
|
unit.Reporting = Convert.ToInt32(temp[2]);
|
|
}
|
|
|
|
public static byte[] GenRequestMsg()
|
|
{
|
|
string msg = ServerMSG.GenMsg(0x0001, ServerConnector.serialNr, "");
|
|
return System.Text.Encoding.ASCII.GetBytes(msg);
|
|
}
|
|
|
|
public static byte[] GenRequestRegMsg()
|
|
{
|
|
string msg = ServerMSG.GenMsg(0x0002, ServerConnector.serialNr, "");
|
|
return System.Text.Encoding.ASCII.GetBytes(msg);
|
|
}
|
|
}
|
|
}
|