×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Regular Contributor
    Join Date
    Oct 2003
    Location
    India
    Posts
    54

    How to use NokiaCLMessaging.IGSMGMS interface?

    Hi,

    1]

    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

    strData = "3000000002010000481C010000008000000000000000000400001000000038100004400010000044000400A10C00000042010A11128200000049C25129544100000030221544A54120000001010A54428200100200008428A10102000000004A10A28084400002088A28A28004000200C10A28A28008000041010A28A28030000042007AF4AFE040100032808703F0105000000C010000000880000000210000000B0040044021106180C83880000424F8FFC1F044800000203FFFFFE042404018102FDFBF60422000250C278F1E21222000A4002FDFBF601F4020A4C03FFFFFE08280005923FFFFFFFC6200013601000000081C08000040C000003000000000003FFFFFC00000"


    '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

    Exit Function
    ErrorTrap:
    ShowError
    End Function

    Please help me

    AVINASH B
    Last edited by abirnale; 2003-11-10 at 14:09.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •