// process
toolkit method
public void processToolkit(
byte event) throws ToolkitException {
ProactiveHandler
ph = ProactiveHandler.getTheHandler();
short i;
switch (event)
{
case EVENT_MENU_SELECTION:
if (MEProfile.check(PROFILE_SEND_SMS) &&
MEProfile.check(PROFILE_GET_INPUT)) {
zipcodeLength
=
getInput(zipcodeName,
zipcode, (byte)1,
(byte)20,
(byte)1);
byte[] tpduSubmit = new byte [120];
short
tpduSubmitLength = (short)(28 + OTA_ADDRESS.length
+
location.length
+ soapAction.length +
operationName.length
+ zipcodeLength);
tpduSubmit [0] = FIRST_BYTE;
tpduSubmit [1] = TP_MR;
for (i = 0; i< OTA_ADDRESS.length; i++)
{
tpduSubmit [(short)(i+2)] = OTA_ADDRESS [i];
}
tpduSubmit [(short)(OTA_ADDRESS.length + 2)] = TP_PID;
tpduSubmit [(short)(OTA_ADDRESS.length + 3)] = TP_DCS;
tpduSubmit [(short)(OTA_ADDRESS.length + 4)] =
(byte)(tpduSubmitLength - (5 + OTA_ADDRESS.length));
tpduSubmit [(short)(OTA_ADDRESS.length + 5)] = (byte)0x02;
tpduSubmit [(short)(OTA_ADDRESS.length + 6)] = (byte)0x70;
tpduSubmit [(short)(OTA_ADDRESS.length + 7)] = (byte)0x00;
tpduSubmit [(short)(OTA_ADDRESS.length + 8)] = (byte)0x00;
tpduSubmit
[(short)(OTA_ADDRESS.length + 9)] =
(byte)(tpduSubmitLength - (10 + OTA_ADDRESS.length));
tpduSubmit [(short)(OTA_ADDRESS.length + 10)] = (byte)0x0D;
for (i = 0; i< 4; i++) {
tpduSubmit [(short)(OTA_ADDRESS.length + 11 + i)] =
(byte)0x00;
}
for (i =
0; i< 3; i++) {
tpduSubmit [(short)(OTA_ADDRESS.length + 15 + i)] =
TAR
[i];
}
for (i = 0; i< 4; i++) {
tpduSubmit [(short)(OTA_ADDRESS.length + 18 + i)] =
(byte)0x00;
}
tpduSubmit [(short)(OTA_ADDRESS.length + 22)] = (byte)0x01;
tpduSubmit [(short)(OTA_ADDRESS.length + 23)] = (byte)0x00;
// we have to send: location, soapAction,
//
operation name and parameters (name, type, value)
tpduSubmit [(short)(OTA_ADDRESS.length + 24)] =
(byte)(location.length);
for (i = 0 ; i < location.length ; i++) {
tpduSubmit [(short)(OTA_ADDRESS.length + 25 + i)] =
location
[i];
}
tpduSubmit [(short)(OTA_ADDRESS.length + 25 +
location.length)]
= (byte)(soapAction.length);
for (i = 0 ; i < soapAction.length ; i++) {
tpduSubmit [(short)(OTA_ADDRESS.length + 26 +
location.length
+ i)] = soapAction [i];
}
|