i have the following enum:
public enum Command_ID : uint
{
none = 0x0,
generic_nack = 0x80000000,
bind_receiver = 0x00000001,
bind_receiver_resp = 0x80000001,
bind_transmitter = 0x00000002,
bind_transmitter_resp = 0x80000002,
query_sm = 0x00000003,
query_sm_resp = 0x80000003,
submit_sm = 0x00000004,
submit_sm_resp = 0x80000004,
deliver_sm = 0x00000005,
deliver_sm_resp = 0x80000005,
unbind = 0x00000006,
unbind_resp = 0x80000006,
replace_sm = 0x00000007,
replace_sm_resp = 0x80000007,
cancel_sm = 0x00000008,
cancel_sm_resp = 0x80000008,
bind_transceiver = 0x00000009,
bind_transceiver_resp = 0x80000009,
outbind = 0x0000000B,
enquire_link = 0x00000015,
enquire_link_resp = 0x80000015,
submit_multi = 0x00000021,
submit_multi_resp = 0x80000021,
alert_notification = 0x00000102,
data_sm = 0x00000103,
data_sm_resp = 0x80000103,
}
I am trying to use the enum as follow:
packet.CmdID = PDU.Command_ID.bind_transceiver;
After this, I am decoding this into an PDU packet (Hex format). Please note, all other necessary information is presented, just not pasted here.
After this I am encoding the entire object to an PDU. When I send this to the SMSC (Short Message Service Centre) simulator, it return the error that the command id is incorrect.
what I would like to know is, what value is actually being returned by the enum Command_ID, is it "bind_transceiver"? if I use the following code
uint x = (uint)Enum.Parse(typeof(PDU.Command_ID), Enum.GetName(typeof(PDU.Command_ID), id));
it returns 9. How can I get the Enum to return 0x00000009??
Thanks for any help in advance