I am trying to send the GMS text-picture message. Can some one please tell me how to use this interface?
2]
Actually i tried to send the concatenated message using the PDU SMSSubmit interface. But the message i sent is displaying in the distorted form. Here is the code i wrote. Please tell me where i am going wrong...
Public Function SendPicMesg() As Integer
Dim smsEntry As NokiaCLMessaging.ShortMessageItem
Dim headerArray() As Byte
Dim dataArray() As Byte, strData As String, strPartData As String
Dim icnt As Integer, tmpCnt As Integer
Dim intMesgs As Integer, intCount As Integer
On Error GoTo ErrorTrap
'PART 1
Set smsEntry = New NokiaCLMessaging.ShortMessageItem
smsEntry.Type = SHORTMESSAGE_TYPE_GSM_SUBMIT
Set pIGSMSubmit = smsEntry.TypeProperties
'Set the destination number
pIGSMSubmit.DestinationAddress = "9448163171" 'DestnNumber
'Set the SMSC number
pIGSMSubmit.ServiceCenterAddress = strSMSCNumber
'Protocol id - 0 meaning this is SMS
pIGSMSubmit.ProtocolID = 0
'TP Validity period
pIGSMSubmit.ValidityPeriodRelative = SMS_ONE_HOUR
'Set the selected coding scheme
pIGSMSubmit.DataCodingScheme = CODING_SCHEME_EIGHT_BIT
ReDim headerArray(0 To 11)
headerArray(0) = &HB 'We have 11 octets in header
headerArray(1) = &H5 '
headerArray(2) = &H4 '
headerArray(3) = &H15 'Destn NBS Port low byte octet
headerArray(4) = &H8A 'Destn NBS Port high byte octet
headerArray(5) = &H15 '
headerArray(6) = &H8A '
headerArray(7) = &H0 '
headerArray(8) = &H3 '
headerArray(9) = &H1 '
headerArray(10) = 3 'Hex$(intMesgs) 'Total mesgs to be sent
headerArray(11) = 1 ' Hex$((intCount / 254) + 1) 'Serial number of this part
pIGSMSubmit.UserDataHeader = headerArray
'Get the message text converted into Hex values
strPartData = Left(strData, 254)
ReDim dataArray(0 To (Len(strPartData) / 2))
For icnt = 0 To ((Len(strPartData) / 2) - 1)
tmpCnt = icnt * 2
dataArray(icnt) = "&H" & Mid(strPartData, tmpCnt + 1, 2)
Next icnt
pIGSMSubmit.UserData = dataArray
'Send the SMS
Call pSMSAdapter.SendSMS(SHORTMESSAGE_ROUTE_TYPE_ANY, pIGSMSubmit)
'PART 2
Set smsEntry = New NokiaCLMessaging.ShortMessageItem
smsEntry.Type = SHORTMESSAGE_TYPE_GSM_SUBMIT
Set pIGSMSubmit = smsEntry.TypeProperties
'Set the destination number
pIGSMSubmit.DestinationAddress = "9448163171" 'DestnNumber
'Set the SMSC number
pIGSMSubmit.ServiceCenterAddress = strSMSCNumber
'Protocol id - 0 meaning this is SMS
pIGSMSubmit.ProtocolID = 0
'TP Validity period
pIGSMSubmit.ValidityPeriodRelative = SMS_ONE_HOUR
'Set the selected coding scheme
pIGSMSubmit.DataCodingScheme = CODING_SCHEME_EIGHT_BIT
ReDim headerArray(0 To 11)
headerArray(0) = &HB 'We have 11 octets in header
headerArray(1) = &H5 '
headerArray(2) = &H4 '
headerArray(3) = &H15 'Destn NBS Port low byte octet
headerArray(4) = &H8A 'Destn NBS Port high byte octet
headerArray(5) = &H15 '
headerArray(6) = &H8A '
headerArray(7) = &H0 '
headerArray(8) = &H3 '
headerArray(9) = &H1 '
headerArray(10) = 3 'Hex$(intMesgs) 'Total mesgs to be sent
headerArray(11) = 2 'Hex$((intCount / 254) + 1) 'Serial number of this part
pIGSMSubmit.UserDataHeader = headerArray
'Get the message text converted into Hex values
strPartData = Mid$(strData, 255, 254)
ReDim dataArray(0 To (Len(strPartData) / 2))
For icnt = 0 To ((Len(strPartData) / 2) - 1)
tmpCnt = icnt * 2
dataArray(icnt) = "&H" & Mid(strPartData, tmpCnt + 1, 2)
Next icnt
pIGSMSubmit.UserData = dataArray
'Send the SMS
Call pSMSAdapter.SendSMS(SHORTMESSAGE_ROUTE_TYPE_ANY, pIGSMSubmit)
'PART 3
Set smsEntry = New NokiaCLMessaging.ShortMessageItem
smsEntry.Type = SHORTMESSAGE_TYPE_GSM_SUBMIT
Set pIGSMSubmit = smsEntry.TypeProperties
'Set the destination number
pIGSMSubmit.DestinationAddress = "9448163171" 'DestnNumber
'Set the SMSC number
pIGSMSubmit.ServiceCenterAddress = strSMSCNumber
'Protocol id - 0 meaning this is SMS
pIGSMSubmit.ProtocolID = 0
'TP Validity period
pIGSMSubmit.ValidityPeriodRelative = SMS_ONE_HOUR
'Set the selected coding scheme
pIGSMSubmit.DataCodingScheme = CODING_SCHEME_EIGHT_BIT
ReDim headerArray(0 To 11)
headerArray(0) = &HB 'We have 11 octets in header
headerArray(1) = &H5 '
headerArray(2) = &H4 '
headerArray(3) = &H15 'Destn NBS Port low byte octet
headerArray(4) = &H8A 'Destn NBS Port high byte octet
headerArray(5) = &H15 '
headerArray(6) = &H8A '
headerArray(7) = &H0 '
headerArray(8) = &H3 '
headerArray(9) = &H1 '
headerArray(10) = 3 'Hex$(intMesgs) 'Total mesgs to be sent
headerArray(11) = 3 'Hex$((intCount / 254) + 1) 'Serial number of this part
pIGSMSubmit.UserDataHeader = headerArray
'Get the message text converted into Hex values
strPartData = Mid$(strData, 509, 254)
ReDim dataArray(0 To (Len(strPartData) / 2))
For icnt = 0 To ((Len(strPartData) / 2) - 1)
tmpCnt = icnt * 2
dataArray(icnt) = "&H" & Mid(strPartData, tmpCnt + 1, 2)
Next icnt
pIGSMSubmit.UserData = dataArray
'Send the SMS
Call pSMSAdapter.SendSMS(SHORTMESSAGE_ROUTE_TYPE_ANY, pIGSMSubmit)
'No error is raised means we sent it !!!
SendPicMesg = pIGSMSubmit.MessageReference