void show_cfg(void) { writeLCD_menu(8); sendCode(nIns,0xC6); for(counter_name=0;counter_name<5;counter_name++) { sendCode(nData,name_device[counter_name]); } sendCode(nIns,0x99); for(counter_name=0;counter_name<4;counter_name++) { sendCode(nData,password[counter_name]); } sendCode(nIns,0xD8); for(counter_name=0;counter_name<3;counter_name++) { sendCode(nData,fcc_r_bandas[counter_name]); } sendCode(nIns,0xE3); for(counter_name=0;counter_name<3;counter_name++) { sendCode(nData,fcc_p_bandas[counter_name]); } sendCode(nIns,0xD3); }
void Tx433_Nexa::sendPackets(String grp, String dev, String onoff) { for (int i = 0; i < RETRANSMIT; i++) { sendSync(); sendCode(TxCode, TxCode.length()); sendCode(grp, grp.length()); sendCode(onoff, onoff.length()); sendCode(ChCode, ChCode.length()); sendCode(dev, dev.length()); sendPause(); } }
void cfg_ECG_options(void) { writeLCD_menu(1); op_multi_select(); if (read == 'A') { writeLCD_menu(2); reset_flag(); op_select(); if(read == 'A') { writeLCD_menu(3); reset_flag(); sendCode(nIns,0x94); enter_device_name(); } else if (read == 'B') { writeLCD_menu(4); reset_flag(); sendCode(nIns,0x94); enter_pass(); } } else if(read == 'B') { writeLCD_menu(5); reset_flag(); op_select(); if(read == 'A') { writeLCD_menu(6); reset_flag(); sendCode(nIns,0x9D); enter_fcc_p_bandas(); } else if (read == 'B') { writeLCD_menu(7); reset_flag(); sendCode(nIns,0x9D); enter_fcc_r_bandas(); } } else if(read == 'C') { reset_flag(); } }
void LoginPage::nextPage() { setFocus(); clearErrors(); if (login_staked_widget_->currentIndex() == SUBPAGE_PHONE_LOGIN_INDEX) { entered_phone_->setText(country_code_->text() + phone_->text()); entered_phone_->adjustSize(); country_code_->setEnabled(false); phone_->setEnabled(false); sendCode(); } else if (login_staked_widget_->currentIndex() == SUBPAGE_UIN_LOGIN_INDEX) { uin_login_edit_->setEnabled(false); uin_password_edit_->setEnabled(false); gui_coll_helper collection(GetDispatcher()->create_collection(), true); collection.set_value_as_qstring("login", uin_login_edit_->text()); collection.set_value_as_qstring("password", uin_password_edit_->text()); collection.set_value_as_bool("save_auth_data", keep_logged_->isChecked()); collection.set_value_as_bool("not_log", true); if (is_login_) { send_seq_ = GetDispatcher()->post_message_to_core("login_by_password", collection.get()); } else { send_seq_ = GetDispatcher()->post_message_to_core("login_by_password_for_attach_uin", collection.get()); } } }
int main(void) { DDRB = 0x03; DDRC = 0x00; PORTB = 0x00; PORTC = 0x01; while (1) { if (PINC & (1 << TRIGGER)) { //while trigger is pushed (looking for digital high) sendCode(); sendCode(); sendCode(); _delay_ms(100); } } }
void LoginPage::init() { QMap<QString, QString> countryCodes = Utils::GetCountryCodes(); combobox_->setEditBoxClass("CountrySearchEdit"); combobox_->setComboboxViewClass("CountrySearchView"); combobox_->setClass("CountySearchWidgetInternal"); combobox_->setPlaceholder(QT_TRANSLATE_NOOP("login_page","Type country or code")); country_search_widget_->layout()->addWidget(combobox_); combobox_->setSources(countryCodes); connect(combobox_, SIGNAL(selected(QString)), this, SLOT(countrySelected(QString)), Qt::QueuedConnection); connect(this, SIGNAL(country(QString)), this, SLOT(redrawCountryCode()), Qt::QueuedConnection); connect(next_page_link_, SIGNAL(clicked()), this, SLOT(nextPage()), Qt::QueuedConnection); connect(prev_page_link_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection); connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection); connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(stats_edit_phone()), Qt::QueuedConnection); connect(switch_login_link_, SIGNAL(clicked()), this, SLOT(switchLoginType()), Qt::QueuedConnection); connect(resend_button_, SIGNAL(clicked()), this, SLOT(sendCode()), Qt::QueuedConnection); connect(resend_button_, SIGNAL(clicked()), this, SLOT(stats_resend_sms()), Qt::QueuedConnection); connect(timer_, SIGNAL(timeout()), this, SLOT(updateTimer()), Qt::QueuedConnection); connect(proxy_settings_link_, SIGNAL(clicked()), this, SLOT(openProxySettings()), Qt::QueuedConnection); country_code_->setProperty("CountryCodeEdit", true); phone_->setProperty("PhoneNumberEdit", true); phone_->setAttribute(Qt::WA_MacShowFocusRect, false); phone_->setPlaceholderText(QT_TRANSLATE_NOOP("login_page","your phone number")); phone_widget_->layout()->addWidget(country_code_); phone_widget_->layout()->addWidget(phone_); Testing::setAccessibleName(phone_, "StartWindowPhoneNumberField"); connect(country_code_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection); connect(country_code_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection); connect(phone_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection); connect(phone_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection); connect(uin_login_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(uin_password_edit_, SIGNAL(textEdited(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(codeEditChanged(QString)), Qt::QueuedConnection); connect(country_code_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(country_code_, SIGNAL(textEdited(QString)), this, SLOT(countryCodeChanged(QString)), Qt::QueuedConnection); connect(phone_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(phone_, SIGNAL(emptyTextBackspace()), this, SLOT(emptyPhoneRemove()), Qt::QueuedConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(getSmsResult(int64_t, int, int)), this, SLOT(getSmsResult(int64_t, int, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResult(int64_t, int)), this, SLOT(loginResult(int64_t, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachUin(int64_t, int)), this, SLOT(loginResultAttachUin(int64_t, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachPhone(int64_t, int)), this, SLOT(loginResultAttachPhone(int64_t, int)), Qt::DirectConnection); country_code_->setValidator(new QRegExpValidator(QRegExp("[\\+\\d]\\d*"))); phone_->setValidator(new QRegExpValidator(QRegExp("\\d*"))); code_edit_->setValidator(new QRegExpValidator(QRegExp("\\d*"))); combobox_->selectItem(Utils::GetTranslator()->getCurrentPhoneCode()); error_label_->hide(); phone_->setFocus(); country_code_->setFocusPolicy(Qt::ClickFocus); initLoginSubPage(SUBPAGE_PHONE_LOGIN_INDEX); }
void kommuHandler(void){ int i; while(buildCommand(input_buf,command)){ switch(command[0]){ case 'a': if(kommuConnected){ sendCommand("a",1); kommuNoPing = 0; } break; case 'b': sendCommand("c",1); kommuConnected = 1; kommuNoPing = 0; HAL_GPIO_WritePin(GPIOD,GPIO_PIN_12,GPIO_PIN_SET); break; case 's': stopRecording(command[1]); break; case 'r': if(kommuConnected){ startRecording(command[1]); } break; case 'q': stopRecordingAll(); break; case 'x': if(kommuConnected){ changeValue(command+1); } break; } } if(kommuConnected){ for(i = 0; i < sendingCodesCurrent; i++){ sendCode(sendingCodes[i],buffer); } } if(kommuNoPing > maxPingsMissed){ //Max ping loss? kommuConnected = 0; HAL_GPIO_WritePin(GPIOD,GPIO_PIN_12,GPIO_PIN_RESET); }else{ kommuNoPing++; } if((output_currentPos>0) && !ptrUSART->GetStatus().tx_busy){ ptrUSART->Send(output_currentBuffer,output_currentPos); if(output_currentBufferNr == 1){ output_currentBuffer = output_buffer2; output_currentBufferNr = 2; }else{ output_currentBuffer = output_buffer1; output_currentBufferNr = 1; } output_currentPos = 0; } }
/** * Format data: * pppppppp|prrrdddd|dddddddd|dddddddd (32 bit) * p = perioud (9 bit unsigned int * r = repeats as 2log. Thus, if r = 3, then signal is sent 2^3=8 times * d = data */ void RemoteTransmitter::sendTelegram(unsigned long data) { RemoteReceiver::disable(); unsigned int periodusec = (unsigned long)data >> 23; unsigned short repeats = ((unsigned long)data >> 20) & 0b111; sendCode(data, periodusec, repeats); RemoteReceiver::enable(); }
int main (void){ DDRB = 0xFF; PORTB = 0x00; on(); //Use CTC mode and toggle OCR0A/B on match TCCR0B = 1; TIMSK = _BV(OCIE0A) | _BV(OCIE0B); while (1){ sendCode(codeSetList[0],POWER); delay(0); } }
//-------------------------------------------------------------- void initLCD(void) { int i; delay(n15msec); /* Send initialization instructions */ /* Loop for sending each character from the array */ for(i=0;i<5;i++) { sendCode(nIns, InitializeLCD[i]); /* send initialization instructions */ } }
int main(void) { cfgPorts(); UARTinit(); initLCD(); sendCode(nIns,0x80); for(;;) { if(UART0_S1 & 0x20) { DT = UART0_D; sendCode(nData,DT); } } return 0; }
int main(void) { cfgPortsLCD(); //configuracion de puertos del LCD 20x4 cfgPortBot(); //configuracion de puertos del teclado matricial sendCode(nIns,0x01); for(;;) { cfg_ECG_options(); confirmacion(); } return 0; }
void initLCD(void) { unsigned int i; /* local index */ //LCD requires a delay of 15 msec delay(n15mseg); /* wait for 15 mseg */ /* send initialization instructions */ /* Loop for sending each character from the array */ for(i=0;i<5;i++) { sendCode(nIns, InitializeLCD[i]); /* send initialization instructions */ } }
string HttpJailServer::receive(){ if(socket->getHeader("Expect")== "100-continue"){ sendCode(continueCode); } int sizeToRead=atoi(socket->getHeader("Content-Length").c_str()); if(sizeToRead != 0){ if(sizeToRead > JAIL_REQUEST_MAX_SIZE){ throw HttpException(requestEntityTooLargeCode ,"http Request size too large" ,socket->getHeader("Content-Length")); } return socket->receive(sizeToRead); } return ""; }
void loop() { //Start our main Arduino Loop enableRFID(); //Enable the RFID card getRFIDTag(); //Reads the tag if(isCodeValid()) { //Validates that the tag is good disableRFID(); //Puts the RFID reader in to low power mode sendCode(); //Sends the code read to the serial port delay(ITERATION_LENGTH); //Debounce? } else { disableRFID(); //Got a incomplete code.. Serial.println("Got some noise"); } Serial.flush(); clearCode(); }
int main(void) { cfgPortPS2(); cfgPortsLCD(); sendCode (nIns,0x80); teclado = 0; memory = 0; sendCode (nIns,0x0F); for(;;) { if ((data_ready) && (data != 0xF0)) { teclado = data; data_ready = 0; } else { teclado = 0; } teclado_use(); } return 0; }
void write_w_key(void) { while(read == 0) { botread(); } if (read == '#') { stop = 1; } else { sendCode(nData,read); } }
void QGLFrame::openFileDialog() { QString filePath = QFileDialog::getOpenFileName(this,tr("Fragment Shader File"),"./../Shadertoy",tr("Files (*.fsh)")); qDebug()<<filePath; QFile fShaderFile(filePath); if(fShaderFile.open(QFile::ReadOnly | QFile::Text)) { this->code = fShaderFile.readAll(); stopRenderThread(); initRenderThread(); RenderThread.doRendering=true; emit sendCode(this->code); } else qDebug() <<"Error unable to open file:" << filePath; }
void SMWServer::sendVisibleRoomEntries(NetClient& client) { if (!rooms.size()) { sendCode(client, NET_RESPONSE_NO_ROOMS); return; } printf("Sending %lu rooms:\n", rooms.size()); auto it = rooms.begin(); while (it != rooms.end()) { Room* room = &it->second; if (room->visible) { RoomInfoPackage roomInfo; { roomInfo.protocolMajorVersion = NET_PROTOCOL_VERSION_MAJOR; roomInfo.protocolMinorVersion = NET_PROTOCOL_VERSION_MINOR; roomInfo.packageType = NET_RESPONSE_ROOM_LIST_ENTRY; roomInfo.roomID = room->roomID; memcpy(roomInfo.name, room->name, NET_MAX_ROOM_NAME_LENGTH); roomInfo.name[NET_MAX_ROOM_NAME_LENGTH - 1] = '\0'; roomInfo.passwordRequired = false; if (room->password[0] != '\0') roomInfo.passwordRequired = true; roomInfo.currentPlayerCount = 0; for (long unsigned p = 0; p < 4; p++) if (room->players[p]) roomInfo.currentPlayerCount++; roomInfo.gamemodeID = room->gamemodeID; printf(" room %d: {%s; pass?: %d; players: %d}\n", roomInfo.roomID, roomInfo.name, roomInfo.passwordRequired, roomInfo.currentPlayerCount); } client.sendData(&roomInfo, sizeof(RoomInfoPackage)); } ++it; } }
int main(void) { // Stop whatchdog WDTCTL = WDTPW + WDTHOLD; // Set clock to 1 MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; if (DEBUG) SerialBegin(SERIALSPEED, CLK_SPEED); // Init the Ports and the timers initPorts(); if (DEBUG) { serialPrintln("Init Done!"); serialPrint("CLK at: "); serialPrintInt(CLK_SPEED); serialPrintln(" MHz"); serialPrint("PWM at: "); serialPrintInt(PWM_FREQUZENCY); serialPrintln(" kHz"); serialPrint("Periode: "); serialPrintInt(PWM_PERIODE); serialPrintln(" clkCycles"); } // Do forever and for always while(1) { // If Push Button pressed if (!(P1IN & BIT3)) { // Send specifid Code sendCode(CODE); // Display sending with LED on P1OUT |= BIT0; // Wait so that no Burst can be sended _delay_cycles(DELAY_BETWEEN_TWO_SENDS); } else { // Turn LED off P1OUT &= ~BIT0; } } }
int main(void) { cfgPorts(); initLCD(); /* sendCode(nIns,0x88); sendCode(nData,'D'); sendCode(nData,'A'); sendCode(nData,'N'); sendCode(nData,'T'); sendCode(nData,'E'); */ unsigned char ContadorUni =0x30; unsigned char ContadorDec =0x30; unsigned char ContadorCen =0x30; for(;;) { ContadorUni ++; delay(n125msec); /*Tiempo variable*/ if (ContadorUni ==0x3A) { ContadorUni =0x30; ContadorDec++; } sendCode(nIns,0x88); sendCode(nData,ContadorUni); if (ContadorDec == 0X3A) { ContadorDec = 0x30; ContadorCen++; } sendCode(nIns,0x87); sendCode(nData,ContadorDec); if (ContadorCen == 0x3A) { ContadorCen = 0x30; } sendCode(nIns,0x86); sendCode(nData,ContadorCen); } return 0; }
void SMWServer::sendVisibleRoomEntries(NetPeer& client) { if (!rooms.size()) { sendCode(client, NET_RESPONSE_NO_ROOMS); return; } printf("Sending %lu rooms:\n", rooms.size()); auto it = rooms.begin(); while (it != rooms.end()) { Room* room = &it->second; // only visible if public and has valid map if (room->visible && room->mapPackage.data) { NetPkgs::RoomInfo roomInfo; { roomInfo.roomID = room->roomID; strncpy(roomInfo.name, room->name, NET_MAX_ROOM_NAME_LENGTH); roomInfo.name[NET_MAX_ROOM_NAME_LENGTH - 1] = '\0'; roomInfo.passwordRequired = false; if (room->password[0] != '\0') roomInfo.passwordRequired = true; roomInfo.currentPlayerCount = 0; for (long unsigned p = 0; p < 4; p++) if (room->players[p]) roomInfo.currentPlayerCount++; roomInfo.gamemodeID = room->gamemodeID; printf(" room %d: {%s; pass?: %d; players: %d}\n", roomInfo.roomID, roomInfo.name, roomInfo.passwordRequired, roomInfo.currentPlayerCount); } client.sendReliable(&roomInfo, sizeof(NetPkgs::RoomInfo)); } ++it; } }
void SMWServer::onConnect(NetPeer* new_client) { printf("Connect event [%lu].\n", new_client->getPlayerID()); // Is there a player already with this address+port? if (players.count(new_client->getPlayerID())) players.erase(new_client->getPlayerID()); removeInactivePlayers(); if (maxPlayerCount <= players.size()) { sendCode(new_client, NET_RESPONSE_CONNECT_SERVERFULL); log("[warning] Server full..."); // TODO: disconnect } else { players[new_client->getPlayerID()].setClient(new_client); log("[info] New connection from %s", new_client->addressAsString().c_str()); } }
void enter_pass(void) { for (counter_name=0;counter_name<4;counter_name++) { password[counter_name] = ' '; } counter_name = 0; while((counter_name < 4)) { while(read == 0) { botread(); } if((read>=0x30)&&(read<0x3A)) { sendCode(nData,read); password[counter_name] = read; counter_name++; } reset_flag(); } stop = 0; }
void enter_fcc_r_bandas(void) { for (counter_name=0;counter_name<3;counter_name++) { fcc_r_bandas[counter_name] = ' '; } counter_name = 0; while((counter_name < 3)) { while(read == 0) { botread(); } if((read>=0x30)&&(read<0x3A)) { sendCode(nData,read); fcc_r_bandas[counter_name] = read; counter_name++; } reset_flag(); } stop = 0; }
void loop() { // If button pressed, send the code. int buttonState = kl_gpioread(BUTTON_PIN); if (lastButtonState == HIGH && buttonState == LOW) { printf("Released\n"); enableIRIn(); // Re-enable receiver } if (buttonState) { printf("Pressed, sending\n"); kl_gpiowrite(STATUS_PIN, HIGH); sendCode(lastButtonState == buttonState); kl_gpiowrite(STATUS_PIN, LOW); usleep(50000); // Wait a bit between retransmissions } else if (decode(&results)) { kl_gpiowrite(STATUS_PIN, HIGH); storeCode(&results); resume(); // resume receiver kl_gpiowrite(STATUS_PIN, LOW); } lastButtonState = buttonState; }
int main(void) { cfgPortPS2(); cfgPortsLCD(); teclado = 0; memory = 0; mayus = 0; pos = 0; shift = 0; page = 0; uart = 0; UARTinit(); sendCode(nIns,0x0D); for(place=0; place <= 255; place++) { LCD[place]= ' '; } writting = 0; for(;;) { teclado_use(); if (writting) { LCD_use(); writting = 0; } if (uart) { UARTsend(); uart = 0; } } return 0; }
int main(void) { cfgPorts(); initLCD(); unsigned char Unidades= 0x30; unsigned char Decenas= 0x30; unsigned char Centenas= 0x30; for(;;) { Unidades++; delay(n1sec); if(Unidades==0x3A) { Unidades=0x30; Decenas++; } sendCode(nIns, 0x88); sendCode(nData, Unidades); if(Decenas==0x3A) { Decenas=0x30; Centenas++; } sendCode(nIns, 0x87); sendCode(nData, Decenas); if(Centenas==0x3A) { Centenas=0x30; } sendCode(nIns, 0x86); sendCode(nData, Centenas); } return 0; }
void writeLCD_menu(char menu) { switch(menu) { case 1: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_principal[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_principal[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_principal[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_principal[pos]); } sendCode(nIns,0xA7); break; case 2: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_bt[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_bt[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_bt[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_bt[pos]); } sendCode(nIns,0xA7); break; case 3: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_nombre_dis[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_nombre_dis[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_nombre_dis[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_nombre_dis[pos]); } break; case 4: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_contra[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_contra[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_contra[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_contra[pos]); } break; case 5: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_filtro[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_filtro[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_filtro[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_filtro[pos]); } sendCode(nIns,0xA7); break; case 6: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_pbandas[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_pbandas[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_pbandas[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_pbandas[pos]); } break; case 7: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_cfg_rbandas[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_cfg_rbandas[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_cfg_rbandas[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_cfg_rbandas[pos]); } break; case 8: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,menu_confirmacion[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,menu_confirmacion[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,menu_confirmacion[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,menu_confirmacion[pos]); } break; case 9: for(pos=0;pos<20;pos++) { sendCode(nIns,0x80+pos); sendCode(nData,error_display[pos]); } for(pos=20;pos<40;pos++) { sendCode(nIns,0xAC+pos); sendCode(nData,error_display[pos]); } for(pos=40;pos<60;pos++) { sendCode(nIns,0x80+pos-20); sendCode(nData,error_display[pos]); } for(pos=60;pos<80;pos++) { sendCode(nIns,0xAC+pos-20); sendCode(nData,error_display[pos]); } break; } }
/** * Format data: * pppppppp|prrrdddd|dddddddd|dddddddd (32 bit) * p = perioud (9 bit unsigned int * r = repeats as 2log. Thus, if r = 3, then signal is sent 2^3=8 times * d = data */ void RemoteTransmitter::sendTelegram(unsigned long data, unsigned short pin) { unsigned int periodusec = (unsigned long)data >> 23; unsigned short repeats = ((unsigned long)data >> 20) & B111; sendCode(pin, data, periodusec, repeats); }