Example #1
0
extern int
main(int argc, const char *argv[]) {
    static const UChar32
    codePoints[]={
        0xd, 0x20, 0x2d, 0x35, 0x65, 0x284, 0x665, 0x5678, 0x23456, 0x10317, 0x1D01F, 0x10fffd
    };
    int i;

    for(i=0; i<sizeof(codePoints)/sizeof(codePoints[0]); ++i) {
        printProps(codePoints[i]);
        puts("");
    }

    u_cleanup();
    return 0;
}
void rDeviceERHandMotor::onInit()
{
	RD_DEVICE_CLASS(Base)::onInit();
	
	// find joint
	_joint = _rdc.m_deviceAPI->getJointID(_rdc.m_robotname, _rdc.m_nodename);

	// find system device and set device buffer
	TCHAR device_mem_name[256];
	_stprintf(device_mem_name, _T("%s::%s"), _rdc.m_robotname, _systemDeviceName);
	ERHand_DeviceMemory_t* mem = (ERHand_DeviceMemory_t*)(_rdc.m_deviceAPI->getMemory(device_mem_name));
	//ERHand_DeviceMemory_t* mem = (ERHand_DeviceMemory_t*)(_rdc.m_deviceAPI->getMemory(_systemDeviceName));
	_systemDevice = _rdc.m_deviceAPI->getDeviceID(_rdc.m_robotname, _systemDeviceName);
	_deviceMem = &(mem->pwm_demand[_channel]);

	// print out device properties
	printProps();
}
void rDeviceAllegroDogMotor::onInit()
{
	RD_DEVICE_CLASS(Base)::onInit();
	
	// find joint
	//_joint = _rdc.m_deviceAPI->getJointID(_rdc.m_robotname, _rdc.m_nodename);
	//comment out because unnecessary

	// find system device and set device buffer
	AllegroDog_DeviceMemory_t* mem = (AllegroDog_DeviceMemory_t*)(_rdc.m_deviceAPI->getMemory(_systemDeviceName));
	_systemDevice             = _rdc.m_deviceAPI->getDeviceID(_rdc.m_robotname, _systemDeviceName);
	_deviceMem_pos            = &(mem->pos_demand[_rt_joint]);
	_deviceMem_vel            = &(mem->vel_demand[_rt_joint]);
	_deviceMem_cur            = &(mem->cur_demand[_rt_joint]);
	_deviceMem_cmd            = &(mem->cmd_demand[_rt_joint]);
	_deviceMem_opmode         = &(mem->mode_of_op[_rt_joint]);
	_deviceMem_opmode_display = &(mem->mode_of_op_disp[_rt_joint]);
	_deviceMem_opstatus       = &(mem->op_status[_rt_joint]);
	_deviceMem_faultstatus    = &(mem->falut_status[_rt_joint]);

	// print out device properties
	printProps();
}