本文整理汇总了C++中System::BaseBoardId方法的典型用法代码示例。如果您正苦于以下问题:C++ System::BaseBoardId方法的具体用法?C++ System::BaseBoardId怎么用?C++ System::BaseBoardId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::BaseBoardId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char *argv[]) {
DIO *dio;
System *sys;
Time *t;
int socket;
int i,j,n,m,RED_LED;
char* name;
unsigned t0,t1,tot=0;
DIOState val;
tsctl *conn;
/*
if (argv < 3) {
printf("usage: %s <host> <inst>\n",argv[0]);
return 1;
}
*/
conn = TsctlClient("127.0.0.1",NetModeBlocking);
if (!conn) {
perror("socket:");
return 1;
}
dio = NetDIOInit(conn,0);
if (!dio) {
printf("Error initializing DIO\n");
return 1;
}
t = NetTimeInit(conn,0);
if (!t) {
printf("Error initializing Time\n");
return 1;
}
sys = NetSystemInit(conn,0);
if (!sys) {
printf("Error initializing System\n");
return 1;
}
if (!setjmp(conn->exception)) {
t0 = t->Tick(t);
for (i=0;i<1000;i++) {
t1 = t->Tick(t);
if (t1 > t0) {
tot += (t1-t0);
} else {
tot += (0xFFFFFFFF - t0) + t1;
}
t0 = t1;
}
printf("%uus avg round trip time\n",tot/i);
printf("Model ID=%02X\n",sys->ModelId(sys));
printf("BaseBoard ID=%02X\n",sys->BaseBoardId(sys));
RED_LED = sys->MapLookup(sys,ASCIIZ("RED_LED"));
val = dio->GetAsync(dio,RED_LED);
printf("RED_LED=%s\n",DIOValueString(val));
for (i=0;i<100;i++) {
dio->SetAsync(dio,RED_LED,HIGH);
dio->SetAsync(dio,RED_LED,LOW);
}
j = sys->MapLength(sys);
for (i=0;i<j;i++) {
name=sys->MapGet(sys,i,&n);
//printf("%d:%s=%d\n",i,name,n);
/*
m=sys->MapLookup(sys,name);
if (m!=n) {
printf("%s=%d/%d error\n",n,m);
}
*/
}
} else {
printf("exception\n");
}
}