www.beck-ipc.com

BtLib V2.02 - Miscellaneous


Miscellaneous

Functions which don't belong to other groups

  • btReadRS232Settings
  • btWriteRS232Settings
  • btReadAllowConfigurationOverBluetooth
  • btWriteAllowConfigurationOverBluetooth
  • btReadControllerPowerSaveMode
  • btWriteControllerPowerSaveMode
  • btReadMaxOutputPower
  • btWriteMaxOutputPower
  • btReadEscSequenceTiming
  • btWriteEscSequenceTiming
  • btWriteEscChar
  • btReadWatchdogSettings
  • btWriteWatchdogSettings
  • btResetDevice
  • btReadDtrDsrSettings
  • btWriteDtrDsrSettings
  • btReadLinkPolicy
  • btWriteLinkPolicy
  • btReadFeatureMask
  • btWriteFeatureMask
  • btReadChannelMap
  • btWriteChannelMap
  • btReadRSSI


  • int btReadRS232Settings(unsigned long * baudRate, int * dataBits, int * stopBits, int * parity, int * flowControl)

    Read actual settings of the serial interface of the bluetooth device.

    Parameters

    baudRate

    Output parameter: see enum btBaudRate for possible values
    See btWriteRS232Settings for details.

    dataBits

    Output parameter: see enum btDataBits for possible values

    stopBits

    Output parameter: see enum btStopBits for possilbe values

    parity

    Output parameter: see enum btParity for possible values

    flowControl

    Output parameter: see enum btFlowControl for possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    No connection to chip or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteRS232Settings(unsigned long baudRate, int dataBits, int stopBits, int parity, int flowControl, int changeAfterConfirm, int storeInStartupDatabase)

    Writes settings for connecting the BT0x over the serial interface.

    Parameters

    baudRate

    see enum btBaudRate for possible values

    dataBits

    See enum btDataBits for possible values
    If dataBits = 2 (representing 7 data bits) param storeInStartupDatabase must be 1 and the BT0x must be restarted for changes to take effect.

    stopBits

    see enum btStopBits for possible values

    parity

    see enum btParity for possible values

    flowControl

    see enum btFlowControl for possible values

    changeAfterConfirm

    0: wait for reboot
    1: change now

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    If storeInStartupDatabase==1, the values are also stored at chip.ini, so the btInit() function will initialize the module always with these settings after a reboot or restart of the bluetooth application. Since BTLIB V1.04 they are no longer written fixed into the module.
    In that case the IPC@CHIP® can connect to the BT0x after the next power cycle.
    The combination of changeAfterConfirm = 0 and storeInStartupDatabase = 0 does not make sense.


    Top
    Index page


    int btReadAllowConfigurationOverBluetooth(int * allowConfigurationOverBluetooth)

    Read whether it is possible to configure the local bluetooth device over an established bluetooth connection or not.

    Parameters

    allowConfigurationOverBluetooth

    Output parameter: pointer to int variable where to store the actual type.

    0: denied
    1: allowed

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    The remote device must not have the same escape sequence for configuration as the connected device.
    Use btWriteEscChar to change the escape sequence.


    Top
    Index page


    int btWriteAllowConfigurationOverBluetooth(int allowConfigurationOverBluetooth, int storeInStartupDatabase)

    Sets whether it is possible to configure the local bluetooth device over an established bluetooth connection or not.

    Parameters

    allowConfigurationOverBluetooth

    0: denied
    1: allowed

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    The remote device must not have the same escape sequence for configuration as the connected device.
    Use btWriteEscChar to change the escape sequence


    Top
    Index page


    int btReadControllerPowerSaveMode(int * powerSaveMode)

    Reads which power save mode is set for the BT0x.

    Parameters

    powerSaveMode

    Output parameter: pointer to int value to store the actual power save mode

    1: Online mode. The BT0x will not enter a power save mode.
    2: Sleep mode (default value). The Serial Port Adapter will enter sleep mode when possible to save power.
    3: Allow sleep mode and stop mode. The Serial Port Adapter will enter sleep or stop mode when possible to save power.

    enum btPowerSaveMode contains all possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteControllerPowerSaveMode(int powerSaveMode, int storeInStartupDatabase)

    Sets the power save mode of the local bluetooth device.

    Parameters

    powerSaveMode

    the new controller power save mode

    1: Online mode. The BT0x will not enter a power save mode.
    2: Allow sleep mode (default value). The Serial Port Adapter will enter sleep mode when possible to save power.
    3: Allow sleep mode and stop mode. The Serial Port Adapter will enter sleep or stop mode when possible to save power.

    enum btPowerSaveMode contains all possible values
    Stop mode cannot be configured if the DSR mode is 2 (see btWriteDtrDsrSettings).

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btReadMaxOutputPower(int * maxOutputPower)

    Reads the actual output power the local bluetooth device uses for broadcasting.

    Parameters

    maxOutputPower

    Output parameter: pointer to int value to store the actual output power.

    255: Use the highest output power supported by the BT0x as the maximum output power (default value). Other possible values are: 53,78,82,96,115,119,124,130.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteMaxOutputPower(int maxOutputPower, int storeInStartupDatabase)

    Sets the output power of the local bluetooth device to the highest possible value below or even maxOutputPower.

    Parameters

    maxOutputPower

    the new max output power

    255: Use the highest output power supported by the BT0x as the maximum output power (default value). Other possible values are: 53,78,82,96,115,119,124,130.

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    Important Notice!

    The BT05/6 modules must be restarted for the new output power value to take effect. For compatibility reasons the user may still set the storeInStartupDatabase parameter, which in the case of a BT05/6 module is ignored.


    Top
    Index page


    int btReadEscSequenceTiming(int * minBeforeTime, int * minAfterTime)

    For the escape sequence to change to AT mode to be valid, a period of no data activity is required before and after the escape sequence. This function reads the minimum time of no data activity required before and after the escape sequence.

    Parameters

    minBeforeTime

    Output parameter: pointer to int value to store the actual set Time in [ms], which defines the minimum silence on the channel before accepting a following escape sequence.

    minAfterTime

    Output parameter: pointer to int value to store the actual set Time in [ms], which defines the minimum silence on the channel after accepting a recieved escape sequence.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteEscSequenceTiming(int minBeforeTime, int minAfterTime, int storeInStartupDatabase)

    For the escape sequence to change to AT mode to be valid, a period of no data activity is required before and after the escape sequence. This function sets the minimum time of no data activity required before and after the escape sequence.

    Parameters

    minBeforeTime

    Time in [ms], which defines the minimum silence on the channel before accepting a following escape sequence.
    Minimum value: 50 ms, maximum value: 5000 ms.

    minAfterTime

    Time in [ms], which defines the minimum silence on the channel after accepting a recieved escape sequence.
    Minimum value: 50 ms, maximum value: 5000 ms.

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteEscChar(char newEscChar)

    This function sets the character for the escape sequence changing from data mode to AT mode.

    Parameters

    newEscChar

    The new escape character

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    To configure one BT0x over Bluetooth by another BT0x, there must be different escape sequence chars on the devices.
    To allow other devices a configuration over bluetooth see btWriteAllowConfigurationOverBluetooth.


    Top
    Index page


    int btReadWatchdogSettings(int * btWriteTimeout, int * btInactivityTimeout, int * btConnectTimeout, int * btDisconnectReset)

    Reads the actual watchdog settings. Watchdog is only active in BT_DATA_MODE .

    Parameters

    btWriteTimeout

    Output parameter: pointer to int where to store the actual time before disconnecting if out of credits

    0: disabled (default)
    >0: time in seconds

    btInactivityTimeout

    Output parameter: pointer to int where to store the actual time before disconnecting if no activity

    0: disabled (default)
    >0: time in seconds

    btConnectTimeout

    Output parameter: pointer to int where to store the actual max. connection time before disconnecting

    0: disabled (default)
    >0: time in seconds

    btDisconnectReset

    Output parameter: pointer to int where to store whether the BT0x should reset after disconnect or not.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteWatchdogSettings(int btWriteTimeout, int btInactivityTimeout, int btConnectTimeout, int btDisconnectReset, int storeInStartupDatabase)

    Write watchdog settings. Watchdog is only active in BT_DATA_MODE .

    Parameters

    btWriteTimeout

    time before disconnecting if out of credits

    0: disabled (default)
    >0: time in seconds

    btInactivityTimeout

    time before disconnecting if no activity

    0: disabled (default)
    >0: time in seconds

    btConnectTimeout

    max connection time before disconnecting

    0: disabled (default)
    >0: time in seconds

    btDisconnectReset

    reset after disconnect

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btResetDevice(void)

    Resets the device immediately with AT Command.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    The command was sent to the BT0x.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout


    Top
    Index page


    int btReadDtrDsrSettings(int * dtrConfig, int * dsrConfig)

    Reads the settings of the DTR and DSR pins.

    Parameters

    dtrConfig

    Output parameter: pointer to int where to store the actual setting
    1: DTR pin is active after startup (default value)
    2: DTR is only active when connected to another bluetooth device

    enum btDtrConfig contains all possible values

    dsrConfig

    Output parameter: pointer to int where to store the actual setting
    1: Ignore DSR pin (default value)
    2: If DSR pin switches to active, the module will try to connect to a remote peer if a remote peer is configured. If DSR pin switches to inactive, the module will disconnect.
    For the remote peer, the external connect scheme must be set. (see btReadDefaultRemotePeer).

    enum btDsrConfig contains all possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteDtrDsrSettings(int * dtrConfig, int * dsrConfig, int storeInStartupDatabase)

    Writes the settings of the DTR and DSR pins.

    Parameters

    dtrConfig

    1: DTR pin is active after startup (default value)
    2: DTR is only active when connected to another bluetooth device

    enum btDtrConfig contains all possible values

    dsrConfig

    1: Ignore DSR pin (default value)
    2: If DSR pin switches to LOW, the module will try to connect to a remote peer if a remote peer is configured. If DSR pin switches to HIGH, the module will disconnect.
    For the remote peer, the external connect scheme must be set (see btWriteDefaultRemotePeer ).

    enum btDsrConfig contains all possible values

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    DSR mode 2 cannot be configured if module is configured for stop mode (see btWriteControllerPowerSaveMode).


    Top
    Index page


    int btReadLinkPolicy(int * linkPolicy, int * parameter)

    Reads the actual link policy.

    Parameters

    linkPolicy

    Output parameter: pointer to storage of size int where to store the actual setting
    Link policy configurations:
    0: Default, no sniff, all packet sizes.
    1: Receiver, no sniff, 1 slot packets
    2: Sender, no sniff, 5 slot packets
    3: QoS, no sniff, all packet sizes, short poll interval

    The following policies with sniff may be used to get a link with a specific respose time or to decrease the power consumption:
    4: Sniff, interval 10ms, 1 slot packets
    5: Sniff, interval 50ms, 1 slot packets
    6: Sniff, interval 100ms, 1 slot packets
    7: Sniff, interval 200ms, 1 slot packets
    8: Sniff, interval 500ms, 1 slot packets

    The following policies with only DM1 packets extend the range of the BT0x but decrease data throughput:
    9: Long range, DM1 packets
    10: Long range, DM1 packets and QoS
    11. Long range, all DM packets
    12. Long range, all DM packets and QoS

    parameter

    Output parameter: pointer to int where to store the actual setting
    Depending on the parameter linkPolicy this parameter defines the following:

    Link policies with sniff (4-8):
    Bit 0:
    If this bit is set, the BT0x receives data on the serial interface. It will try to temporarily exit sniff.
    If there's no data for more than 1s then the link will be put back into sniff mode.
    If this bit is not set, then the link will always be in sniff mode.
    Using exit sniff on data activity may be useful when using longer sniff intervals since these links have a low throughput.

    Link policies with QoS (3,10,12) parameter defines the poll interval:
    0: Use shortest possible poll interval
    >0: pollinterval

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteLinkPolicy(int linkPolicy, int parameter, int storeInStartupDatabase)

    Writes the link policy to the BT0x.

    Parameters

    linkPolicy

    Link policy configurations:
    0: Default, no sniff, all packet sizes.
    1: Receiver, no sniff, 1 slot packets
    2: Sender, no sniff, 5 slot packets
    3: QoS, no sniff, all packet sizes, short poll interval

    The following policies with sniff may be used to get a link with a specific respose time or to decrease the power consumption:
    4: Sniff, interval 10ms, 1 slot packets
    5: Sniff, interval 50ms, 1 slot packets
    6: Sniff, interval 100ms, 1 slot packets
    7: Sniff, interval 200ms, 1 slot packets
    8: Sniff, interval 500ms, 1 slot packets

    Following policies with only DM1 packets extend the range of the BT0x but decrease data throughput.
    9: Long range, DM1 packets
    10: Long range, DM1 packets and QoS
    11. Long range, all DM packets
    12. Long range, all DM packets and QoS

    parameter

    Depending on the parameter linkPolicy this parameter defines following:

    Link policies with sniff (4-8):
    Bit 0: If this bit is set, the BT0x receives data on the serial interface. It will try to temporarily exit sniff.
    If there's no data for more than 1s then the link will be put back into sniff mode.
    If this bit is not set, then the link will always be in sniff mode.
    Using exit sniff on data activity may be useful when using longer sniff intervals since these links have a low throughput.

    Link policies with QoS (3,10,12) parameter defines the pollinterval:
    0: Use shortest possible pollinterval
    >0: pollinterval

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    By changing the link policy it is possible to reduce power consumption, get faster response times, increase the range or to optimize the BT0x as either sender or receiver. This may be useful for some application.

    Note!
    Changing the link policy may lead to interoperability problems. Verify that the chosen link policy works with other devices your application is intended to interoperate with. If not, use the default link policy.

    If you although want to change the link policy, here are some hints:
    Link policy 3,4,10,12 gives the shortest response times.
    Link policy 8 combined with stop mode (see btWriteControllerPowerSaveMode) gives the lowest power consumption.
    If you want to have a high throughput the default link policy is the best for baudrates up to 460800 kbaud. When using a baud rate of 460800 kbaud or more use link policy 2 on the sender and link policy 1 on the receiver.

    The red LED indicates a rejected link policy request by the remote device. In this case the default link policy is used.


    Top
    Index page


    int btReadFeatureMask(int * maskValue)

    Reads the feature mask of the BT0x.

    Parameters

    maskValue

    Output parameter: pointer to int where to store the actual setting
    Bit 0: If set, the LEDs are disabled in stop mode. If the BT0x has an active connection, then the blue LED will be enabled.
    Bit 1: If set page scan activity for faster response to incoming connections is increased.
    Bit 2: If set inquiry scan activity for faster detection of the device during btInquiry or btDeviceDiscovery is increased.

    Default value for all bits is 0.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btWriteFeatureMask(int maskValue)

    Sets the feature mask of the BT0x.

    Parameters

    maskValue

    Bit 0: If set, the LEDs are disabled in stop mode. If the BT0x has an active connection, then the blue LED will be enabled.
    Bit 1: If set page scan activity for faster response to incoming connections is increased.
    Bit 2: If set inquiry scan activity for faster detection of the device during btInquiry or btDeviceDiscovery is increased.

    Default value for all bits is 0. The Serial Port Adapter must be reset for a new feature mask to take affect.

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)


    Top
    Index page


    int btReadChannelMap(int* channel0to15, int* channel16to31, int* channel32to47, int* channel48to63, int* channel63to78)

    Reads the channel map of the BT0x.

    Parameters

    channel0to15

    Output parameter: pointer to int where to store the actual setting.
    bit-pattern as four-digit hex number

    channel16to31

    Output parameter: pointer to int where to store the actual setting.
    bit-pattern as four-digit hex number

    channel32to47

    Output parameter: pointer to int where to store the actual setting.
    bit-pattern as four-digit hex number

    channel48to63

    Output parameter: pointer to int where to store the actual setting.
    bit-pattern as four-digit hex number

    channel63to78

    Output parameter: pointer to int where to store the actual setting.
    bit-pattern as four-digit hex number

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    BT_REPLY_PARSE_ERROR
    Invalid reply received from the module

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    The channel map represents the bluetooth channels which are used. (If it's not explicitly necessary to deactivate channels, e.g. if some WLAN adapters use them) all channels should be active).


    Top
    Index page


    int btWriteChannelMap(int channel0to15, int channel16to31, int channel32to47, int channel48to63, int channel63to78, int storeInStartupDatabase)

    Writes the bluetooth channel map of the BT0x.

    Parameters

    channel0to15

    bit-pattern as four-digit hex number

    channel16to31

    bit-pattern as four-digit hex number

    channel32to47

    bit-pattern as four-digit hex number

    channel48to63

    bit-pattern as four-digit hex number

    channel63to78

    bit-pattern as four-digit hex number

    storeInStartupDatabase

    Determines if settings are valid after reboot.

    enum btStoreInStartupDatabase contains possible values

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success

    WRONG_PARAM_X_ERROR
    Value of parameter X is not valid.
    Numbering of parameters starts at 1.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    This function may be used to deactivate bluetooth channels. By deactivating only one channel the Advanced Frequency Hopping (AFH) will be disabled. (If it's not explicitly necessary to deactivate channels, e.g. if some WLAN adapters use them) all channels should be active because the AFH works very well).
    If the bit is set, the channel is enabled, otherwise it is disabled.
    Remember that the BT0x must be master of the connection to specify which channels should be used.


    Top
    Index page


    int btReadRSSI(char * addr, int * rssi)

    This request returns the current received signal strength, RSSI, for the connection between the Serial Port Adapter and the remote device identified by the 'bd_addr' parameter. Note that this command can only be used on an existing connection that has been established using and only while still in AT mode.

    Parameters

    addr

    Input parameter: Address of the connected module

    rssi

    Output parameter: Contains RSSI on success

    Return Value

    Returns one of the following

    BT_EXIT_SUCCESS
    On success, storage rssi holds the current RSSI value.

    BT_CONNECTION_TO_CHIP_ERROR
    BT0x module not detected or timeout

    BT_REPLY_PARSE_ERROR
    Invalid reply from the module

    BT_CHIP_ERROR
    Bluetooth module returns an error message (no further information available)

    Comments

    Meaning of the RSSI value:
    Less 128: The received signal strength is 128-RSSI dB below the optimal signal range.
    128: The received signal strength is within the optimal signal range.

    Above 128: The received signal strength is RSSI-128 dB above the optimal signal range.
    For example, a read value of 130 means +2 dB.


    Top
    Index page


    End of document