本文整理汇总了C++中BT::setRemoteAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ BT::setRemoteAddress方法的具体用法?C++ BT::setRemoteAddress怎么用?C++ BT::setRemoteAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BT
的用法示例。
在下文中一共展示了BT::setRemoteAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processNXT
void VDIP::processNXT(portConfig *portConfigBuffer)
{
char *name;
char *btAddress;
long freeMemory;
extern BT bt;
if (myEEPROM2.getResetStatus() == (byte) 0){
if(nxtQueryDevice(this,portConfigBuffer->usbDev,&name,&btAddress,&freeMemory)){
bt.setRemoteAddress(btAddress);
delay(100);
myEEPROM2.setResetStatus(1);
delay(1000);
software_Reset(); // increments the "status" so that the ChapR knows it has been reset
}
}
}
示例2: processDisk
//.........这里部分代码省略.........
while (*ptr == '\r' && *ptr == '\n'){
ptr++;
}
if (*ptr == '\0'){
break;
}
}
}
// contains the settings for the digital I/O pins (for FRC, aka ChapR3 of EEPROM)
if (readFile("dgtlIn.txt", buf, BIGENOUGH)){
byte newNum = 0;
for (int i = 0, ptr = 0; i < 8; i++){
byte bit = (buf[ptr] == '1')?1:0;
newNum |= bit<<i;
while (buf[ptr] != '\r' && buf[ptr] != '\0' && buf[ptr] != '\n'){
ptr++;
}
while (buf[ptr] == '\r' || buf[ptr] == '\n'){
ptr++;
}
if (buf[ptr] == '\0'){
break;
}
}
myEEPROM.setDigitalInputs(newNum);
}
// contains the 4 analog inputs (for FRC, aka ChapR3 of EEPROM)
if (readFile("analogIn.txt", buf, BIGENOUGH)){
char *ptr = buf;
for (int i = 0; i < 4; i++){
double value = atof(ptr);
if (value > 0 && value <= 5) {
value = (value*1023)/5;
// TODO - translate to labview preferences here
switch(i) {
case 0: myEEPROM.setAnalogInput1(value); break;
case 1: myEEPROM.setAnalogInput2(value); break;
case 2: myEEPROM.setAnalogInput3(value); break;
case 3: myEEPROM.setAnalogInput4(value); break;
}
}
while (*ptr != '\r' && *ptr != '\0' && *ptr != '\n'){
ptr++;
}
while (*ptr == '\r' || *ptr == '\n'){
ptr++;
}
if (*ptr == '\0'){
break;
}
}
}
// get a target bluetooth connection name/ID AND connect if it is there
// this MAY need to be changed to do the connection AFTER getting
// done with the flash drive. Note that this data IS NOT stored in
// the EEPROM - instead, it is just used as the current paired device
// and will be reset (like normal) whenever a new pairing is done.
extern BT bt;
if(readFile("targetID.txt", buf, BIGENOUGH,true)){
if (bt.addressFilter(buf,BIGENOUGH)) { // useful address?
bt.setRemoteAddress(buf);
delay(100);
}
}
// TODO: make target.txt work - it should take a NAME and find the BT ID for it
if(readFile("target.txt", buf, BIGENOUGH,true)){
// Serial.print("target: \"");
// Serial.print(buf);
// Serial.println("\"");
// if(bt.nameToAddress(buf)) {
// bt.setRemoteAddress(buf);
// delay(100);
// }
}
// the confirm beep indicates that all files that existed were read
// it doesn't confirm that all data was cool
beeper.confirm();
} else {
// the disk was put in the wrong USB port!
beeper.icky();
}
}