mbed HRM11017を使ってkonashi.jsでナイトライダー

Dependencies:   BLE_API_Native_IRC mbed

Fork of BLE_RCBController by Junichi Katsu

Embed: (wiki syntax)

« Back to documentation index

GapAdvertisingParams Class Reference

GapAdvertisingParams Class Reference

This class provides a wrapper for the core advertising parameters, including the advertising type (Connectable Undirected, Non Connectable Undirected, etc.), as well as the advertising and timeout intervals. More...

#include <GapAdvertisingParams.h>

Public Types

enum  AdvertisingType { ADV_CONNECTABLE_UNDIRECTED, ADV_CONNECTABLE_DIRECTED, ADV_SCANNABLE_UNDIRECTED, ADV_NON_CONNECTABLE_UNDIRECTED }
 

Encapsulates the peripheral advertising modes, which determine how the device appears to other central devices in hearing range.

More...

Public Member Functions

 GapAdvertisingParams (AdvertisingType advType=GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED, uint16_t interval=GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, uint16_t timeout=0)
 Instantiates a new GapAdvertisingParams instance.
virtual ~GapAdvertisingParams (void)
virtual AdvertisingType getAdvertisingType (void)
 returns the current Advertising Type value
virtual uint16_t getInterval (void)
 returns the current Advertising Delay (in units of 0.625ms)
virtual uint16_t getTimeout (void)
 returns the current Advertising Timeout (in seconds)

Detailed Description

This class provides a wrapper for the core advertising parameters, including the advertising type (Connectable Undirected, Non Connectable Undirected, etc.), as well as the advertising and timeout intervals.

See the following for more information on advertising types:
  • Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
  • Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
EXAMPLE
    // ToDo

Definition at line 50 of file GapAdvertisingParams.h.


Member Enumeration Documentation

Encapsulates the peripheral advertising modes, which determine how the device appears to other central devices in hearing range.

See the following for more information on advertising types:
  • Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
  • Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
Enumerator:
ADV_CONNECTABLE_UNDIRECTED 

Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1.

ADV_CONNECTABLE_DIRECTED 

Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2.

ADV_SCANNABLE_UNDIRECTED 

Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4.

ADV_NON_CONNECTABLE_UNDIRECTED 

Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3.

Definition at line 66 of file GapAdvertisingParams.h.


Constructor & Destructor Documentation

GapAdvertisingParams ( AdvertisingType  advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
uint16_t  interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
uint16_t  timeout = 0 
)

Instantiates a new GapAdvertisingParams instance.

Parameters:
[in]advTypeThe GAP advertising mode to use for this device. Valid values are defined in AdvertisingType:
ADV_NON_CONNECTABLE_UNDIRECTED
All connections to the peripheral device will be refused.
ADV_CONNECTABLE_DIRECTED
Only connections from a pre-defined central device will be accepted.
ADV_CONNECTABLE_UNDIRECTED
Any central device can connect to this peripheral.
ADV_SCANNABLE_UNDIRECTED
Any central device can connect to this peripheral, and the secondary Scan Response payload will be included or available to central devices.
See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 and Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 for further information on GAP connection modes
Parameters:
[in]intervalAdvertising interval between 0x0020 and 0x4000 in 0.625ms units (20ms to 10.24s). If using non-connectable mode (ADV_NON_CONNECTABLE_UNDIRECTED) this min value is 0x00A0 (100ms).
Increasing this value will allow central devices to detect your peripheral faster at the expense of more power being used by the radio due to the higher data transmit rate.
This field must be set to 0 if connectionMode is equal to ADV_CONNECTABLE_DIRECTED
See Bluetooth Core Specification, Vol 3., Part C, Appendix A for suggested advertising intervals.
Parameters:
[in]timeoutAdvertising timeout between 0x1 and 0x3FFF (1 and 16383) in seconds. Enter 0 to disable the advertising timeout.
EXAMPLE

Definition at line 83 of file GapAdvertisingParams.cpp.

~GapAdvertisingParams ( void   ) [virtual]

Destructor

Definition at line 136 of file GapAdvertisingParams.cpp.


Member Function Documentation

GapAdvertisingParams::AdvertisingType getAdvertisingType ( void   ) [virtual]

returns the current Advertising Type value

Definition at line 145 of file GapAdvertisingParams.cpp.

uint16_t getInterval ( void   ) [virtual]

returns the current Advertising Delay (in units of 0.625ms)

Definition at line 155 of file GapAdvertisingParams.cpp.

uint16_t getTimeout ( void   ) [virtual]

returns the current Advertising Timeout (in seconds)

Definition at line 165 of file GapAdvertisingParams.cpp.