SafeNet/.svn/pristine/fc/fcf23f3be63808dc808c284852ede68161490154.svn-base
2021-02-24 13:50:23 +02:00

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);
}
}
}