本文整理汇总了C++中UUID::getLen方法的典型用法代码示例。如果您正苦于以下问题:C++ UUID::getLen方法的具体用法?C++ UUID::getLen怎么用?C++ UUID::getLen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::getLen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_uuid
/**
* Print the value of a UUID.
*/
static void print_uuid(const UUID &uuid)
{
const uint8_t *uuid_value = uuid.getBaseUUID();
// UUIDs are in little endian, print them in big endian
for (size_t i = 0; i < uuid.getLen(); ++i) {
printf("%02X", uuid_value[(uuid.getLen() - 1) - i]);
}
}
示例2: app_start
void app_start(int, char *[])
{
buffer = (uint8_t*)malloc(24);
memset(buffer, 0, 24);
console.attach(serialHandler);
printf("{{end}}\r\n");
// setup buttons
// button1.mode(PullUp);
// Delay for initial pullup to take effect
wait(.01);
// button1.fall(button1ISR);
// button2.mode(PullUp);
// Delay for initial pullup to take effect
wait(.01);
// button2.fall(button2ISR);
/*************************************************************************/
/*************************************************************************/
/* bluetooth le */
ble.init();
// security
ble.securityManager().onSecuritySetupInitiated(securityInitiated);
ble.securityManager().onSecuritySetupCompleted(securityCompleted);
ble.securityManager().onLinkSecured(linkSecured);
ble.securityManager().onSecurityContextStored(contextStored);
ble.securityManager().onPasskeyDisplay(passkeyDisplay);
// connection status handlers
ble.gap().onConnection(whenConnected);
ble.gap().onDisconnection(whenDisconnected);
// set preferred connection parameters to lowest latency
Gap::ConnectionParams_t fast;
ble.gap().getPreferredConnectionParams(&fast);
fast.minConnectionInterval = 16; // 20 ms
fast.maxConnectionInterval = 32; // 40 ms
fast.slaveLatency = 0;
ble.gap().setPreferredConnectionParams(&fast);
/* construct advertising beacon */
ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED|GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, (const uint8_t *) DEVICE_NAME, sizeof(DEVICE_NAME) - 1);
ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, uuid.getBaseUUID(), uuid.getLen());
ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
ble.gap().setAdvertisingInterval(200);
// Apple uses device name instead of beacon name
ble.gap().setDeviceName((const uint8_t*) DEVICE_NAME);
// ble setup complete - start advertising
ble.gap().startAdvertising();
/*************************************************************************/
/*************************************************************************/
bts = new BlockTransferService();
btc = new BlockTransferClient();
watch = new Timer();
bts->init(uuid, SecurityManager::SECURITY_MODE_ENCRYPTION_OPEN_LINK);
#if 0
writeBlock.push_back(&writeBlockFragment2);
writeBlock.push_back(&writeBlockFragment3);
writeBlock.push_back(&writeBlockFragment4);
#endif
// set callback functions
bts->setWriteAuthorizationCallback(blockServerWriteHandler, &receiveBlock);
bts->setReadAuthorizationCallback(blockServerReadHandler);
printf("BlockTransfer: %s %s %d\r\n", __DATE__, __TIME__, MAX_INDEX_SET_SIZE);
}