uint32_t NexText::Get_background_image_pic(uint32_t *number) { String cmd = String("get "); cmd += getObjName(); cmd += ".pic"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
bool NexButton::getPIC(uint32_t * number) { String cmd = String("get "); cmd += getObjName(); cmd += ".pic"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
bool NexDisplay::getNumeric(const char* varName, uint32_t* value) { char cmd[32]; snprintf(cmd, sizeof(cmd), NexGET, varName); sendCommand(cmd); return recvRetNumber(value); }
bool NexNumber::getValue(uint32_t *number) { String cmd = String("get "); cmd += getObjName(); cmd += ".val"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexText::Get_place_xcen(uint32_t *number) { String cmd; cmd += "get "; cmd += getObjName(); cmd += ".xcen"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexText::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; cmd += getObjName(); cmd += ".pco"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexText::Get_background_crop_picc(uint32_t *number) { String cmd; cmd += "get "; cmd += getObjName(); cmd += ".picc"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexText::getFont(uint32_t *number) { String cmd; cmd += "get "; cmd += getObjName(); cmd += ".font"; sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexGpio::digital_read(uint32_t port) { uint32_t number; char buf; String cmd = String("get "); cmd += "pio"; buf = port + '0'; cmd += buf; sendCommand(cmd.c_str()); recvRetNumber(&number); return number; }
uint32_t NexRtc::read_rtc_time(uint32_t *time,uint32_t len) { uint32_t time_buf[7] = {0}; String cmd; cmd = "get rtc0"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[0]); cmd = ""; cmd = "get rtc1"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[1]); cmd = ""; cmd = "get rtc2"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[2]); cmd = ""; cmd = "get rtc3"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[3]); cmd = ""; cmd = "get rtc4"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[4]); cmd = ""; cmd = "get rtc5"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[5]); cmd = ""; cmd = "get rtc6"; sendCommand(cmd.c_str()); recvRetNumber(&time_buf[6]); for(int i=0;i<len;i++) { time[i] = time_buf[i]; } }
uint32_t NexRtc::read_rtc_time(char *time_type,uint32_t *number) { String cmd = String("get rtc"); char buf[10] = {0}; if(strstr(time_type,"year")) { cmd += '0'; } else if(strstr(time_type,"mon")) { cmd += '1'; } else if(strstr(time_type,"day")) { cmd += '2'; } else if(strstr(time_type,"hour")) { cmd += '3'; } else if(strstr(time_type,"min")) { cmd += '4'; } else if(strstr(time_type,"sec")) { cmd += '5'; } else if(strstr(time_type,"week")) { cmd += '6'; } else{ return false; } sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexGpio::get_pwmfreq(uint32_t *number) { String cmd = String("get pwmf"); sendCommand(cmd.c_str()); return recvRetNumber(number); }
uint32_t NexRtc::read_rtc_time(char *time,uint32_t len) { char time_buf[22] = {"0000/00/00 00:00:00 0"}; uint32_t year,mon,day,hour,min,sec,week; String cmd; cmd = "get rtc0"; sendCommand(cmd.c_str()); recvRetNumber(&year); cmd = ""; cmd = "get rtc1"; sendCommand(cmd.c_str()); recvRetNumber(&mon); cmd = ""; cmd = "get rtc2"; sendCommand(cmd.c_str()); recvRetNumber(&day); cmd = ""; cmd = "get rtc3"; sendCommand(cmd.c_str()); recvRetNumber(&hour); cmd = ""; cmd = "get rtc4"; sendCommand(cmd.c_str()); recvRetNumber(&min); cmd = ""; cmd = "get rtc5"; sendCommand(cmd.c_str()); recvRetNumber(&sec); cmd = ""; cmd = "get rtc6"; sendCommand(cmd.c_str()); recvRetNumber(&week); time_buf[0] = year/1000 + '0'; time_buf[1] = (year/100)%10 + '0'; time_buf[2] = (year/10)%10 + '0'; time_buf[3] = year%10 + '0'; time_buf[5] = mon/10 + '0'; time_buf[6] = mon%10 + '0'; time_buf[8] = day/10 + '0'; time_buf[9] = day%10 + '0'; time_buf[11] = hour/10 + '0'; time_buf[12] = hour%10 + '0'; time_buf[14] = min/10 + '0'; time_buf[15] = min%10 + '0'; time_buf[17] = sec/10 + '0'; time_buf[18] = sec%10 + '0'; time_buf[20] = week + '0'; time_buf[21] = '\0'; if(len >= 22) { for(int i=0;i<22;i++) { time[i] = time_buf[i]; } } else{ for(int i=0;i<len;i++) { time[i] = time_buf[i]; } } }