本文整理汇总了C++中BT::sendDATA方法的典型用法代码示例。如果您正苦于以下问题:C++ BT::sendDATA方法的具体用法?C++ BT::sendDATA怎么用?C++ BT::sendDATA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BT
的用法示例。
在下文中一共展示了BT::sendDATA方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send
uint8_t Remote::send(uint8_t id, uint8_t type)
{
switch(id)
{
case REMOTE_BATTERY:
return bt.sendDATA(id, type, (void *) &battery_percent, sizeof(uint8_t));
case REMOTE_STATUS:
return bt.sendDATA(id, type, (void *) &timer.status, sizeof(timer_status));
case REMOTE_PROGRAM:
return bt.sendDATA(id, type, (void *) &timer.current, sizeof(program));
case REMOTE_START:
return bt.sendDATA(id, type, 0, 0);
case REMOTE_STOP:
return bt.sendDATA(id, type, 0, 0);
}
return 0;
}
示例2: send
uint8_t Remote::send(uint8_t id, uint8_t type)
{
switch(id)
{
case REMOTE_BATTERY:
return bt.sendDATA(id, type, (void *) &battery_percent, sizeof(battery_percent));
case REMOTE_STATUS:
return bt.sendDATA(id, type, (void *) &timer.status, sizeof(timer.status));
case REMOTE_PROGRAM:
return bt.sendDATA(id, type, (void *) &timer.current, sizeof(timer.current));
case REMOTE_MODEL:
{
uint8_t tmp = REMOTE_MODEL_TLP;
return bt.sendDATA(id, type, (void *) &tmp, sizeof(uint8_t));
}
case REMOTE_FIRMWARE:
{
unsigned long version = VERSION;
void *ptr = &version;
return bt.sendDATA(id, type, ptr, sizeof(version));
}
case REMOTE_BT_FW_VERSION:
{
uint8_t btVersion = bt.version();
return bt.sendDATA(id, type, (void *) &btVersion, sizeof(btVersion));
}
case REMOTE_PROTOCOL_VERSION:
{
unsigned long remoteVersion = REMOTE_VERSION;
void *ptr = &remoteVersion;
return bt.sendDATA(id, type, ptr, sizeof(remoteVersion));
}
case REMOTE_CAMERA_FPS:
return bt.sendDATA(id, type, (void *) &conf.cameraFPS, sizeof(conf.cameraFPS));
case REMOTE_CAMERA_MAKE:
return bt.sendDATA(id, type, (void *) &conf.cameraMake, sizeof(conf.cameraMake));
case REMOTE_ISO:
{
uint8_t tmp = camera.iso();
return bt.sendDATA(id, type, (void *) &tmp, sizeof(tmp));
}
case REMOTE_APERTURE:
{
uint8_t tmp = camera.aperture();
return bt.sendDATA(id, type, (void *) &tmp, sizeof(tmp));
}
case REMOTE_SHUTTER:
{
uint8_t tmp = camera.shutter();
return bt.sendDATA(id, type, (void *) &tmp, sizeof(tmp));
}
case REMOTE_VIDEO:
{
uint8_t tmp = camera.recording;
return bt.sendDATA(id, type, (void *) &tmp, sizeof(tmp));
}
case REMOTE_LIVEVIEW:
{
uint8_t tmp = camera.modeLiveView;
return bt.sendDATA(id, type, (void *) &tmp, sizeof(tmp));
}
case REMOTE_THUMBNAIL:
{
menu.message(STR("Busy"));
/*
uint8_t ret = camera.getCurrentThumbStart();
if(ret != PTP_RETURN_ERROR)
{
bt.sendDATA(REMOTE_THUMBNAIL_SIZE, type, (void *) &PTP_Bytes_Total, sizeof(PTP_Bytes_Total));
bt.sendDATA(id, type, (void *) PTP_Buffer, PTP_Bytes_Received);
while(ret == PTP_RETURN_DATA_REMAINING)
{
ret = camera.getCurrentThumbContinued();
bt.sendDATA(id, type, (void *) PTP_Buffer, PTP_Bytes_Received);
}
}
*/
///////////////////////// DEMO Code ////////////////////////////
PTP_Bytes_Total = sizeof(thm);
bt.sendDATA(REMOTE_THUMBNAIL_SIZE, type, (void *) &PTP_Bytes_Total, sizeof(PTP_Bytes_Total));
uint16_t total_sent = 0, i;
while(total_sent < PTP_Bytes_Total)
{
for(i = 0; i < PTP_BUFFER_SIZE; i++)
{
PTP_Buffer[i] = pgm_read_byte(&thm[i + total_sent]);
if(total_sent + i >= PTP_Bytes_Total) break;
}
PTP_Bytes_Received = i;
total_sent += PTP_Bytes_Received;
if(PTP_Bytes_Received == 0) break;
bt.sendDATA(id, type, (void *) PTP_Buffer, PTP_Bytes_Received);
if(total_sent >= PTP_Bytes_Total) break;
}
/////////////////////////////////////////////////////////////////
return 0;
}
default:
return bt.sendDATA(id, type, 0, 0);
}
//.........这里部分代码省略.........
示例3: debugMessage
uint8_t Remote::debugMessage(char *str)
{
uint8_t len = 0;
while(*(str + len) != '\0' && len < 255) len++;
return bt.sendDATA(REMOTE_DEBUG, REMOTE_TYPE_SEND, (void *) str, len);
}
示例4: set
uint8_t Remote::set(uint8_t id, uint8_t value)
{
return bt.sendDATA(id, REMOTE_TYPE_SET, (void *) &value, sizeof(value));
}
示例5: unWatch
uint8_t Remote::unWatch(uint8_t id)
{
return bt.sendDATA(id, REMOTE_TYPE_NOTIFY_UNWATCH, 0, 0);
}
示例6: request
uint8_t Remote::request(uint8_t id)
{
requestActive = 1;
return bt.sendDATA(id, REMOTE_TYPE_REQUEST, 0, 0);
}