BLE::Central class of PicoRuby
Type aliases
service_t
{
start_handle: Integer,
end_handle: Integer,
uuid128: String,
uuid32: (Integer | nil),
characteristics: Array[characteristic_t]
}
characteristic_t
{
start_handle: Integer,
value_handle: Integer,
end_handle: Integer,
properties: Integer,
uuid128: String,
uuid32: (Integer | nil),
value: (String | nil),
descriptors: Array[descriptor_t]
}
descriptor_t
{
handle: Integer,
uuid128: String,
uuid32: (Integer | nil),
value: (String | nil)
}
scan_type_t
:passive|:active
Instance methods
advertising_report_callback
instance.advertising_report_callback(BLE::AdvertisingReport) -> void
connect
instance.connect(BLE::AdvertisingReport) -> bool
discover_characteristic_descriptors
instance.discover_characteristic_descriptors(Integer, Integer, Integer) -> Integer
discover_characteristics_for_service
instance.discover_characteristics_for_service(Integer, Integer, Integer) -> Integer
discover_primary_services
instance.discover_primary_services(Integer) -> Integer
get_packet
instance.get_packet() -> String
read_value_of_characteristic_using_value_handle
instance.read_value_of_characteristic_using_value_handle(Integer, Integer) -> Integer
reset_state
instance.reset_state() -> Symbol
scan
instance.scan(
?scan_type: scan_type_t,
?scan_interval: Integer,
?scan_window: Integer,
?timeout_ms: Integer|nil,
?stop_state: Symbol,
?debug: bool
) -> void
set_scan_params
instance.set_scan_params(scan_type_t scan_type, Integer scan_interval, Integer scan_window) -> 0
start_scan
instance.start_scan() -> 0
stop_scan
instance.stop_scan() -> 0
Attr accessors
state (reader)
instance.state -> Symbol
services (reader)
instance.services -> Array[service_t]