using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace SN_Server.ServerMSGS { public class SM_SMS { public static InterthreadMessageQueue recvSMSQueue = new InterthreadMessageQueue(); public static InterthreadMessageQueue sendSMSQueue = new InterthreadMessageQueue(); public static InterthreadMessageQueue confSMSQueue = new InterthreadMessageQueue(); public static ArrayList waitConfSMSList = new ArrayList(); private ServerMSG _sm; public SMS sms; public SM_SMS(ServerMSG sm) { _sm = sm; sms = new SMS(); DecodePayload(sm.Payload); } private void DecodePayload(string paylaod) { string[] temp = paylaod.Split('/'); sms.DBid = Convert.ToInt32(temp[0]); sms.SUDBid = Convert.ToInt32(temp[1]); sms.RadioID = temp[2]; sms.Msg = temp[3]; } public static byte[] GenRequestMsg() { string msg = ServerMSG.GenMsg(0x0012, ServerConnector.serialNr, ""); return System.Text.Encoding.ASCII.GetBytes(msg); } public static byte[] GenSMSInsertMsg(SMS sms) { string msg = ServerMSG.GenMsg(0xB012, ServerConnector.serialNr, sms.SUDBid + "/" + sms.Msg); return System.Text.Encoding.ASCII.GetBytes(msg); } public static byte[] GenSMSAckMsg(SMS sms) { string msg = ServerMSG.GenMsg(0xBA12, ServerConnector.serialNr, sms.DBid + "/read"); return System.Text.Encoding.ASCII.GetBytes(msg); } } }