pub async fn new(
        bt_session: BluetoothSession,
        device: DeviceId,
    ) -> Result<BBQDevice, BluetoothError> {
        let service = bt_session
            .get_service_by_uuid(&device, BBQ_SERVICE_UUID)
            .await?
            .id;
        let setting_result_characteristic = bt_session
            .get_characteristic_by_uuid(&service, SETTING_RESULT_UUID)
            .await?
            .id;
        let account_and_verify_characteristic = bt_session
            .get_characteristic_by_uuid(&service, ACCOUNT_AND_VERIFY_UUID)
            .await?
            .id;
        let history_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, HISTORY_DATA_UUID)
            .await?
            .id;
        let real_time_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, REAL_TIME_DATA_UUID)
            .await?
            .id;
        let setting_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, SETTING_DATA_UUID)
            .await?
            .id;
        Ok(BBQDevice {
            bt_session,
            setting_result_characteristic,
            account_and_verify_characteristic,
            history_data_characteristic,
            real_time_data_characteristic,
            setting_data_characteristic,
        })
    }
/// Construct a new BBQDevice wrapper around an appropriate Bluetooth device which is already
/// connected.
Construct a new BBQDevice wrapper around an appropriate Bluetooth device which is already
connected.
Construct a new BBQDevice wrapper around an appropriate Bluetooth device which is already connected .
pub async fn new(
        bt_session: BluetoothSession,
        device: DeviceId,
    ) -> Result<BBQDevice, BluetoothError> {
        let service = bt_session
            .get_service_by_uuid(&device, BBQ_SERVICE_UUID)
            .await?
            .id;
        let setting_result_characteristic = bt_session
            .get_characteristic_by_uuid(&service, SETTING_RESULT_UUID)
            .await?
            .id;
        let account_and_verify_characteristic = bt_session
            .get_characteristic_by_uuid(&service, ACCOUNT_AND_VERIFY_UUID)
            .await?
            .id;
        let history_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, HISTORY_DATA_UUID)
            .await?
            .id;
        let real_time_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, REAL_TIME_DATA_UUID)
            .await?
            .id;
        let setting_data_characteristic = bt_session
            .get_characteristic_by_uuid(&service, SETTING_DATA_UUID)
            .await?
            .id;
        Ok(BBQDevice {
            bt_session,
            setting_result_characteristic,
            account_and_verify_characteristic,
            history_data_characteristic,
            real_time_data_characteristic,
            setting_data_characteristic,
        })
    }
pub async fn new ( bt_session : BluetoothSession , device : DeviceId , ) -> Result < BBQDevice , BluetoothError > { let service = bt_session . get_service_by_uuid ( & device , BBQ_SERVICE_UUID ) . await ? . id ; let setting_result_characteristic = bt_session . get_characteristic_by_uuid ( & service , SETTING_RESULT_UUID ) . await ? . id ; let account_and_verify_characteristic = bt_session . get_characteristic_by_uuid ( & service , ACCOUNT_AND_VERIFY_UUID ) . await ? . id ; let history_data_characteristic = bt_session . get_characteristic_by_uuid ( & service , HISTORY_DATA_UUID ) . await ? . id ; let real_time_data_characteristic = bt_session . get_characteristic_by_uuid ( & service , REAL_TIME_DATA_UUID ) . await ? . id ; let setting_data_characteristic = bt_session . get_characteristic_by_uuid ( & service , SETTING_DATA_UUID ) . await ? . id ; Ok ( BBQDevice { bt_session , setting_result_characteristic , account_and_verify_characteristic , history_data_characteristic , real_time_data_characteristic , setting_data_characteristic , } ) }
Construct a new BBQDevice wrapper around an appropriate Bluetooth device which is already
connected.
Construct a new BBQDevice wrapper around an appropriate Bluetooth device which is already connected .
bt_session
BluetoothSession
device
DeviceId
bt_session
BluetoothSession
device
DeviceId