www.beck-ipc.com

BtLib V2.02 - Definitions and chip.ini settings


Data structures, chip.ini settings and error codes / return values

  • BluetoothDevice
  • BluetoothService
  • BluetoothVersion

  • Constants and error codes/return values

                
    #define BT_DATA_MODE                  0
    #define BT_AT_MODE                    1
    
    #define BT_EXIT_SUCCESS               0
    #define BT_EXIT_FAILURE              -1
    #define BT_CHIP_ERROR                -2
    #define BT_CONNECTION_TO_CHIP_ERROR  -3
    #define BT_CHIP_INI_ENTRY_ERROR      -4
    #define BT_OUT_OF_MEMORY_ERROR       -5
    #define BT_WRONG_PARAM_1_ERROR      -11
    #define BT_WRONG_PARAM_2_ERROR      -12
    #define BT_WRONG_PARAM_3_ERROR      -13
    #define BT_WRONG_PARAM_4_ERROR      -14
    #define BT_WRONG_PARAM_5_ERROR      -15
    #define BT_WRONG_PARAM_6_ERROR      -16
    #define BT_WRONG_PARAM_7_ERROR      -17
    #define BT_REPLY_PARSE_ERROR        -20  // An reply from the module has a invalid format
    #define BT_INVALID_MODULE_ERROR     -21  // Module is not a Beck IPC Bluetooth device
    #define BT_RESOURCE_ERROR           -22  // Some kind of resource (e.g. semaphore) is not available
    #define BT_TIMEOUT_ERROR            -23  // An opertaion timed out


    chip.ini entries

    The following chip.ini entries are supported at section [BLUETOOTH]:

    If an entry does not exist in chip.ini, the default entry (marked with *) is taken by btInit

                
    DEFINE                           KEYWORD         VALUES
    BT_INI_SECTION_NAME              "BLUETOOTH"
    
    BT_INI_FOSSILPORT_ITEM_NAME      "PORT"          SC1x3/SC2x: EXT, COM, *SER2*, SER3
    BT_INI_FOSSILPORT_ITEM_NAME      "PORT"          SC243: UART1, ... , *UART6*
    
    BT_INI_BAUDRATE_ITEM_NAME        "BAUDRATE"      300(BT01/02 only), 1200, 2400 - 460800; default: 57600
                                                     (non standard rate 750000 also possible)
    BT_INI_PARITY_ITEM_NAME          "PARITY"        *NO*,  ODD, EVEN
    BT_INI_WORDLENGTH_ITEM_NAME      "WORDLENGTH"    7 (BT01/02 only), *8*
    BT_INI_STOPBITS_ITEM_NAME        "STOPBITS"      *1*, 2
    BT_INI_FLOWCONTROL_ITEM_NAME     "FLOWCONTROL"   *RTSCTS*, OFF
    BT_INI_ESC_CHAR_ITEM_NAME        "ESCCHAR"       char; default: /
    BT_INI_MIN_BEFORE_TIME_ITEM_NAME "MINBEFORETIME" 50 - 5000; default: 1000
    BT_INI_MIN_AFTER_TIME_ITEM_NAME  "MINAFTERTIME"  50 - 5000; default: 1000
    
    BT_INI_CONN_STATUS_PIO_ITEM_NAME "CONNSTATUSPIO" SC1x3/SC2x: -1,0 - 31; default: 1  (-1: not used)
    BT_INI_CONN_STATUS_PIO_ITEM_NAME "CONNSTATUSPIO" SC243     : -1,0 - 39; default: 37 (-1: not used)
    
    BT_INI_CONN_DSR_PIO_ITEM_NAME    "CONNDSRPIO"    SC1x3/SC2x: -1,0 - 31; default: 0  (-1: not used)
    BT_INI_CONN_DSR_PIO_ITEM_NAME    "CONNDSRPIO"    SC243     : -1,0 - 39; default: 38 (-1: not used)
    
    BT_INI_RESETPIO_ITEM_NAME        "RESETPIO"      SC1x3/SC2x: 0 - 31; (128:RTS0, 129: RTS1) default: 17
    BT_INI_RESETPIO_ITEM_NAME        "RESETPIO"      SC243     : 0 - 39; default: 36
    
    Please note: If RTS0 or RTS1 is specified as Reset PIO, the library forces the RTSx line
    internally with fossil_force_rts(). RTS0 or RTS1 are not usable, if the corresponding
    serial port is in use by the BT0x module itself or otherwise with hardware flow control enabled.


    BluetoothDevice structure

    struct
    {
      char bdAddr[13];
      long cod;
      int deviceNameValid;
      char deviceName[BT_MAX_DEVNAME];
      long rssi;
    } BluetoothDevice;
    

    Members

    bdAddr[13]
    Bluetooth device address
    cod
    The class of device (see function btGetMajorDeviceClass and enum btMajorDeviceClass for details.)
    deviceNameValid
    1: Device name is valid, otherwise 0
    deviceName[BT_MAX_DEVNAME]
    Name of the bluetooth device
    rssi
    RSSI value: 128: 0 dbm. E.g. 130 means +2dbm

    Comments

    structure


    Top
    Index page

    BluetoothService structure

    struct
    {
      char bdAddr[13];
      int rfcommServerChan;
      int serviceNameValid;
      char serviceName[32];
      int audioFeedbackSupportValid;
      int audioFeedbackSupport;
    } BluetoothService;
    

    Members

    bdAddr[13]
    Bluetooth device address
    rfcommServerChan
    RFCOMM server channel number on which this service can be found. It is used when connecting to a profile. Range 1 to 30.
    serviceNameValid
    1: Service name valid, otherwise 0
    serviceName[32]
    the name of the service
    audioFeedbackSupportValid
    1: AudioFeebackSupport value is valid, otherwise 0
    audioFeedbackSupport
    1: Audio feeback support is offered by the service, otherwise 0

    Comments

    Structure for BT0x service information


    Top
    Index page

    BluetoothVersion structure

    struct
    {
      char manufacturer[32];
      char swVer[32];
      char hostStackSwVer[32];
      char linkManagerSwVer[32];
      char bluetoothHardwareManufacturer[32];
    } BluetoothVersion;
    

    Members

    manufacturer[32]
    Bluetooth adapter manufacturer.
    swVer[32]
    Bluetooth adapter software version.
    hostStackSwVer[32]
    Bluetooth host stack version.
    linkManagerSwVer[32]
    Bluetooth link manager version.
    bluetoothHardwareManufacturer[32]
    Bluetooth hardware manufacturer.

    Comments

    Structure for BT0x version information


    Top
    Index page

    BtEdmConnCb

                
    typedef void huge (far *btEdmConnCb)(BOOL connect,
    				     int handle,
    				     char const *bdAddr,
    				     unsigned frameSize);

    Comments

    Type of callback function called on connect/diconect event.

    connect
      Indicates whether a peer device has been connected (true) or disconnected (false)

    handle
      Connection handle

    bdAddr
      Bluetooth address of the peer device as a zero-terminated string (NULL on disconnect)

    frameSize
      Frame size of this connection, i.e. the maximum number of bytes that can be sent at once (0 on disconnect)


    Top
    Index page


    End of document