当前位置: 首页>>代码示例>>C++>>正文


C++ BT::sendDATA方法代码示例

本文整理汇总了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;
}
开发者ID:LCousineau,项目名称:TimelapsePlus-Firmware,代码行数:17,代码来源:remote.cpp

示例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);
	}
//.........这里部分代码省略.........
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:101,代码来源:remote.cpp

示例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);
}
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:6,代码来源:remote.cpp

示例4: set

uint8_t Remote::set(uint8_t id, uint8_t value)
{
	return bt.sendDATA(id, REMOTE_TYPE_SET, (void *) &value, sizeof(value));
}
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:4,代码来源:remote.cpp

示例5: unWatch

uint8_t Remote::unWatch(uint8_t id)
{
	return bt.sendDATA(id, REMOTE_TYPE_NOTIFY_UNWATCH, 0, 0);
}
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:4,代码来源:remote.cpp

示例6: request

uint8_t Remote::request(uint8_t id)
{
	requestActive = 1;
	return bt.sendDATA(id, REMOTE_TYPE_REQUEST, 0, 0);
}
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:5,代码来源:remote.cpp


注:本文中的BT::sendDATA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。