async def set_ibeacon_major(self, crownstone_id: int, major: int, index: int = 0) -> MeshResult: """ :param crownstone_id: int crownstoneUid, 1-255 :param major: int: uint16 0-65535 :param index: for the normal uuid, index = 0, when alternating you also need to define 1 in a followup command. Usually 0 has already been set by the setup procedure. :return: """ statePacket = ControlStateSetPacket(StateType.IBEACON_MAJOR, index) statePacket.loadUInt16(major) return await self._set_state_via_mesh_acked(crownstone_id, statePacket.getPacket())
async def set_ibeacon_uuid(self, crownstone_id: int, uuid: str, index: int = 0) -> MeshResult: """ :param crownstone_id: int crownstoneUid, 1-255 :param uuid: string: "d8b094e7-569c-4bc6-8637-e11ce4221c18" :param index: for the normal uuid, index = 0, when alternating you also need to define 1 in a followup command. Usually 0 has already been set by the setup procedure. :return: """ statePacket = ControlStateSetPacket(StateType.IBEACON_UUID, index) statePacket.loadByteArray( Conversion.ibeaconUUIDString_to_reversed_uint8_array(uuid)) return await self._set_state_via_mesh_acked(crownstone_id, statePacket.getPacket())
async def _setState(self, packet: ControlStateSetPacket): """ Write set state command, and check result. """ await self.core.control._writeControlAndGetResult(packet.getPacket())