LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Communication

opCOM_READY

  • Test if communication is busy
  • Dispatch status may be set to BUSYBREAK
  • If name is 0 then own adapter status is evaluated
    Parameters
    (DATA8)HARDWARE - Hardware Transport Layer
    (DATA8*)*pNAME - Name of the remote/own device

    opCOM_TEST
  • Test if communication is busy
  • Dispatch status is set to NOBREAK
  • If name is 0 then own adapter busy status is returned

    Parameters
    (DATA8)HARDWARE - Hardware Transport Layer
    (DATA8*)*pNAME - Name of the remote/own device
    Returns
    (DATA8) Busy - busy flag (0 = Ready, 1 = Busy)

    opCOM_READ (CMD, ....)
  • Communication read
  • Dispatch status unchanged

    Parameters
    (DATA8)CMD - Specific command Specific command parameter
    • CMD = COMMAND
    (DATA32)LENGTH - Maximal code stream length
    Returns
    (DATA32) *IMAGE - Address of image
    (DATA32) *GLOBAL - Address of global variables
    (DATA8) FLAG - Flag that tells if image is ready

    opCOM_WRITE (CMD, ....)
  • Communication write
  • Dispatch status unchanged

    Parameters
    (DATA8)CMD - Specific command Specific command parameter
    • CMD = REPLY
    Returns
    (DATA32) *IMAGE - Address of image
    (DATA32) *GLOBAL - Address of global variables

    opMAILBOX_OPEN
  • Open a mail box on the brick
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)NO - Reference ID for the mailbox. Maximum number of mailboxes is 30
    (DATA8)BOXNAME - Zero terminated string with the mailbox name
    (DATA8)TYPE - Data type of the content of the mailbox TYPE enum
    (DATA8)FIFOSIZE - Not used
    (DATA8)VALUES - Number of values of the type (specified by TYPE).

    If data type DATA_S is selected then it requires that a zero terminated string is send.
    Maximum mailbox size is 250 bytes. I.e. if type is string (DATA_S) then there can only be 1 string
    of maximum 250 bytes (incl. zero termination), or if array (DATA_A), then array size cannot be
    larger than 250 bytes


    opMAILBOX_WRITE

  • Write to mailbox in remote brick
  • Dispatch status can return FAILBREAK

    If Brick name is left empty (0) then all connected devices will
    receive the mailbox message

    Parameters
    (DATA8)BRICKNAME - Zero terminated string name of the receiving brick
    (DATA8)HARDWARE - Transportation media
    (DATA8)BOXNAME - Zero terminated string name of the receiving mailbox
    (DATA8)TYPE - Data type of the values TYPE enum
    (DATA8)VALUES - Number of values of the specified type to send
    If string type (DATA_S) data is to be transmitted then a zero terminated string is
    expected.

    If array type data (DATA_A) is to be transmitted then the number of bytes to be send
    is equal to the array size


    opMAILBOX_READ

  • Read data from mailbox specified by NO
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)NO - Messagebox ID of the message box you want to read
    (DATA16)LENGTH - Maximum bytes to be read
    (DATA8)VALUES - Number of value to read
    Returns
    (Type specified in open) VALUE - Data from the message box
    The type of Value is specified by mailbox open byte code.

    opMAILBOX_TEST
  • Tests if new message has been read
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)NO - Reference ID mailbox number
    Returns
    (DATA8) BUSY - If Busy = TRUE then no new messages are received

    opMAILBOX_READY
  • Waiting from message to be read
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)NO - Reference ID mailbox number

    opMAILBOX_CLOSE
  • Closes mailbox indicated by NO
  • Dispatch status can return FAILBREAK
    • Parameters
      (DATA8)NO - Reference ID mailbox number

      opCOM_GET (CMD, ....)
  • Communication get entry
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)CMD - comgetsetsubcode


    • CMD = GET_ON_OFF
      Get active state
    • CMD = GET_VISIBLE
      Get visibility state
    • CMD = GET_RESULT
      Get status. This command gets the result of the command that
      is being executed. This could be a search or a connection
      request.
    • CMD = GET_PIN
      Get pin code. For now "1234" is returned
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)NAME - First character in character string
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) PINCODE - First character in character string


    • CMD = SEARCH_ITEMS
      Get number of item from search. After a search has been completed,
      SEARCH ITEMS will return the number of remote devices found.
    • CMD = SEARCH_ITEM
      Get search item informations. Used to retrieve the item information
      in the search list
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)ITEM - Item - index in search list
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) NAME - First character in character string
      • Returns
        (DATA8) PARRED - Parred [0,1]
      • Returns
        (DATA8) CONNECTED - Connected [0,1]
      • Returns
        (DATA8) TYPE - Bluetooth Device Types
      • Returns
        (DATA8) VISIBLE - Visible [0,1]


    • CMD = FAVOUR_ITEMS
      Get no of item in favourite list. The number of paired devices, not
      necessarily visible or present devices
    • CMD = FAVOUR_ITEM
      Get favourite item informations. Used to retrieve the item information
      in the favourite list. All items in the favourite list are paired devices
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)ITEM - Item - index in favourite list
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) NAME - First character in character string
      • Returns
        (DATA8) PARRED - Parred [0,1]
      • Returns
        (DATA8) CONNECTED - Connected [0,1]
      • Returns
        (DATA8) TYPE - Bluetooth Device Types


    • CMD = GET_ID
      Get bluetooth address information
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) STRING - First character in BT adr string


    • CMD = GET_BRICKNAME
      Gets the name of the brick
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) NAME - First character in brick name


    • CMD = GET_NETWORK
      Gets the network information. WIFI only
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Returns
        (DATA8) NAME - First character in AP name
      • Returns
        (DATA8) MAC - First character in MAC adr string
      • Returns
        (DATA8) IP - First character in IP no string


    • CMD = GET_PRESENT
      Return if hardare is present. WIFI only
    • CMD = GET_ENCRYPT
      Returns the encryption mode of the hardware. WIFI only
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)ITEM - Item - index in favourite list
      • Parameters
        (DATA8)TYPE - Encryption type


    • CMD = GET_INCOMMING
      Returns the encryption mode of the hardware. WIFI only
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)LENGTH - Max length of returned string
      • Parameters
        (DATA8)NAME - First character in name


        opCOM_SET (CMD, ....)
  • Communication set entry
  • Dispatch status can return FAILBREAK

    Parameters
    (DATA8)CMD - comgetsetsubcode


    • CMD = SET_MODE2
      Set active mode state, either active or not
    • CMD = SET_ON_OFF
      Set active state, either on or off
    • CMD = SET_VISIBLE
      Set visibility state - Only available for bluetooth
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)VISIBLE - Visible [0,1], 1 = visible, 0 = invisible


    • CMD = SET_SEARCH
      Control search. Starts or or stops the search for remote devices
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)SEARCH - Search [0,1] 0 = stop search, 1 = start search


    • CMD = SET_PIN
      Set pin code. Set the pincode for a remote device.
      Used when requested by bluetooth.
      not at this point possible by user program
      • Parameters
        *(DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)NAME - First character in character string
      • Parameters
        (DATA8)PINCODE - First character in character string


    • CMD = SET_PASSKEY
      Set pin code. Set the pincode for a remote device.
      Used when requested by bluetooth.
      not at this point possible by user program
      • Parameters
        *(DATA8)Hardware - Hardware Transport Layer
      • Parameters
        *(DATA8)ACCEPT - Acceptance [0,1] 0 = reject 1 = accept


    • CMD = SET_CONNECTION
      Control connection. Initiate or closes the connection request to a
      remote device by the specified name
      • Parameters
        (DATA8)Hardware - Hardware Transport Layer
      • Parameters
        *(DATA8)NAME - First character in Name
      • Parameters
        (DATA8)CONNECTION - Connect [0,1], 1 = Connect, 0 = Disconnect


    • CMD = SET_BRICKNAME
      Sets the name of the brick
      • Parameters
        (DATA8)NAME - First character in character string


    • CMD = SET_MOVEUP
      Moves the index in list one step up. Used to re-arrange WIFI list
      Only used for WIFI
    • CMD = SET_MOVEDOWN
      Moves the index in list one step down. Used to re-arrange WIFI list
      Only used for WIFI
    • CMD = SET_ENCRYPT
      Moves the index in list one step down. Only used for WIFI
      • Parameters
        (DATA8)HARDWARE - Hardware Transport Layer
      • Parameters
        (DATA8)ITEM - Index in table
      • Parameters
        (DATA8)ENCRYPT - Encryption type


    • CMD = SET_SSID
      Sets the SSID name. Only used for WIFI