sipTestLogic.cc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. #pragma once
  2. #include "uart/ProtocolSender.h"
  3. #include "voip/media_player.h"
  4. #include "manager/ConfigManager.h"
  5. #include "core/utilities.h"
  6. #include "service/BusinessConfig.h"
  7. #include "core/wavfile.h"
  8. #include "voip/audio_player.h"
  9. #include "zkaudio.h"
  10. /*
  11. *此文件由GUI工具生成
  12. *文件功能:用于处理用户的逻辑相应代码
  13. *功能说明:
  14. *========================onButtonClick_XXXX
  15. 当页面中的按键按下后系统会调用对应的函数,XXX代表GUI工具里面的[ID值]名称,
  16. 如Button1,当返回值为false的时候系统将不再处理这个按键,返回true的时候系统将会继续处理此按键。比如SYS_BACK.
  17. *========================onSlideWindowItemClick_XXXX(int index)
  18. 当页面中存在滑动窗口并且用户点击了滑动窗口的图标后系统会调用此函数,XXX代表GUI工具里面的[ID值]名称,
  19. 如slideWindow1;index 代表按下图标的偏移值
  20. *========================onSeekBarChange_XXXX(int progress)
  21. 当页面中存在滑动条并且用户改变了进度后系统会调用此函数,XXX代表GUI工具里面的[ID值]名称,
  22. 如SeekBar1;progress 代表当前的进度值
  23. *========================ogetListItemCount_XXXX()
  24. 当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表的总数目,XXX代表GUI工具里面的[ID值]名称,
  25. 如List1;返回值为当前列表的总条数
  26. *========================oobtainListItemData_XXXX(ZKListView::ZKListItem *pListItem, int index)
  27. 当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表当前条目下的内容信息,XXX代表GUI工具里面的[ID值]名称,
  28. 如List1;pListItem 是贴图中的单条目对象,index是列表总目的偏移量。具体见函数说明
  29. *========================常用接口===============
  30. *LOGD(...) 打印调试信息的接口
  31. *mTextXXXPtr->setText("****") 在控件TextXXX上显示文字****
  32. *mButton1Ptr->setSelected(true); 将控件mButton1设置为选中模式,图片会切换成选中图片,按钮文字会切换为选中后的颜色
  33. *mSeekBarPtr->setProgress(12) 在控件mSeekBar上将进度调整到12
  34. *mListView1Ptr->refreshListView() 让mListView1 重新刷新,当列表数据变化后调用
  35. *mDashbroadView1Ptr->setTargetAngle(120) 在控件mDashbroadView1上指针显示角度调整到120度
  36. *
  37. * 在Eclipse编辑器中 使用 “alt + /” 快捷键可以打开智能提示
  38. */
  39. void setSipTestTheme() {
  40. int sipTestThemeInt = StoragePreferences::getInt(STORE_THEME, defaultThemeInt);
  41. if (sipTestThemeInt == 1) {
  42. msip_backPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/back_bule.png");
  43. mSipPicPainterPtr->setBackgroundPic("/medicalCare/dianhua.png");
  44. mEditTextDestURIPtr->setBackgroundPic("/function/input.png");
  45. mCallButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  46. mHandleKeys1CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  47. mHandleKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  48. mHandleKeys3CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  49. mPanelKeys1CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  50. mPanelKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  51. mPanelKeys3CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");;
  52. mPanelKeys4CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  53. mSosKeysCheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  54. mSosKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  55. mRecordTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  56. mDoorLightTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  57. mColorTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_blue_190_52.png");
  58. }
  59. else if (sipTestThemeInt == 2) {
  60. msip_backPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/back_pink.png");
  61. mSipPicPainterPtr->setBackgroundPic("/medicalCare/dianhua-pink.png");
  62. mEditTextDestURIPtr->setBackgroundPic("/function/input-pink.png");
  63. mCallButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190x52.png");
  64. mHandleKeys1CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  65. mHandleKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  66. mHandleKeys3CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  67. mPanelKeys1CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  68. mPanelKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  69. mPanelKeys3CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  70. mPanelKeys4CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  71. mSosKeysCheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  72. mSosKeys2CheckboxPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  73. mRecordTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  74. mDoorLightTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  75. mColorTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink_190_52.png");
  76. }
  77. }
  78. static base::MediaPlayer media_player;
  79. namespace {
  80. FILE* file = NULL;
  81. class RecordTest : public Thread {
  82. public:
  83. void recordAudio() {
  84. file = wavfile_write_open("/mnt/usb1/record.wav");
  85. if (0 != zk_audio_input_init(2, 8000)) {
  86. LOGD("audio input init failed");
  87. mRecordTestButtonPtr->setText(LANGUAGEMANAGER->getValue("RecordFailed"));
  88. mRecordTestButtonPtr->setSelected(false);
  89. return;
  90. }
  91. // //aec apc 初始化
  92. // init();
  93. const int buf_len = zk_audio_input_get_channel_buffer_size();
  94. uint8_t* buf[2];
  95. buf[0] = (uint8_t*)malloc(buf_len);
  96. buf[1] = (uint8_t*)malloc(buf_len);
  97. time_t deadline = time(NULL) + 5;
  98. while (time(NULL) < deadline) {
  99. zk_audio_input_get_frame((uint8_t**)buf);
  100. wavfile_write(file, ( short*) buf[1],
  101. ZK_AUDIO_NUMBER_OF_SAMPLES_PER_FRAME);
  102. }
  103. free(buf[0]);
  104. free(buf[1]);
  105. zk_audio_input_deinit();
  106. wavfile_write_close(file);
  107. mRecordTestButtonPtr->setText(LANGUAGEMANAGER->getValue("RecordPlay"));
  108. playAudio();
  109. }
  110. void playAudio() {
  111. zk_audio_output_set_volume_native(zk_audio_output_volume_native_max());
  112. std::ifstream ifs("/mnt/usb1/record.wav",
  113. std::ios::binary | std::ios::in);
  114. if (!ifs.is_open()) {
  115. LOGD("file not found");
  116. return;
  117. }
  118. base::AudioParameter in;
  119. in.number_of_channels = 1;
  120. in.sample_rate = 8000;
  121. in.sample_format = base::SAMPLE_FMT_S16;
  122. base::AudioPlayer player(in);
  123. uint8_t buffer[256];
  124. player.Play();
  125. while (!ifs.eof()) {
  126. ifs.read((char*)buffer, int(sizeof(buffer)));
  127. int n = ifs.gcount();
  128. player.PutSamples(buffer, n);
  129. }
  130. ifs.close();
  131. player.Stop();
  132. mRecordTestButtonPtr->setText(LANGUAGEMANAGER->getValue("RecordStop"));
  133. mRecordTestButtonPtr->setSelected(false);
  134. }
  135. void Record() {
  136. if(!isRunning()) {
  137. mRecordTestButtonPtr->setText(LANGUAGEMANAGER->getValue("RecordStart"));
  138. play_ = true;
  139. this->run("recordTest");
  140. }
  141. }
  142. void Play() {
  143. if(!isRunning()) {
  144. play_ = false;
  145. this->run("recordTest");
  146. }
  147. }
  148. virtual bool threadLoop() {
  149. if(play_) {
  150. recordAudio();
  151. return false;
  152. }
  153. playAudio ();
  154. return false;
  155. }
  156. private:
  157. bool play_ = true;
  158. };
  159. static RecordTest recordTest;
  160. }
  161. static bool panelKeys1Checkbox = false;
  162. static bool panelKeys2Checkbox = false;
  163. static bool panelKeys3Checkbox = false;
  164. static bool panelKeys4Checkbox = false;
  165. static bool handleKeys1Checkbox = false;
  166. static bool handleKeys2Checkbox = false;
  167. static bool handleKeys3Checkbox = false;
  168. static bool sosKeysCheckbox = false;
  169. static bool sosKeys2Checkbox = false;
  170. void setCheckbox(std::string check) {
  171. if (check == "KEY5") {
  172. if (panelKeys1Checkbox) {
  173. panelKeys1Checkbox = false;
  174. mPanelKeys1CheckboxPtr->setChecked(false);
  175. }
  176. else {
  177. panelKeys1Checkbox = true;
  178. mPanelKeys1CheckboxPtr->setChecked(true);
  179. }
  180. }
  181. if (check == "KEY;") {
  182. if (panelKeys2Checkbox) {
  183. panelKeys2Checkbox = false;
  184. mPanelKeys2CheckboxPtr->setChecked(false);
  185. }
  186. else {
  187. panelKeys2Checkbox = true;
  188. mPanelKeys2CheckboxPtr->setChecked(true);
  189. }
  190. }
  191. if (check == "KEY<") {
  192. if (panelKeys3Checkbox) {
  193. panelKeys3Checkbox = false;
  194. mPanelKeys3CheckboxPtr->setChecked(false);
  195. }
  196. else {
  197. panelKeys3Checkbox = true;
  198. mPanelKeys3CheckboxPtr->setChecked(true);
  199. }
  200. }
  201. if (check == "KEY>") {
  202. if (panelKeys4Checkbox) {
  203. panelKeys4Checkbox = false;
  204. mPanelKeys4CheckboxPtr->setChecked(false);
  205. }
  206. else {
  207. panelKeys4Checkbox = true;
  208. mPanelKeys4CheckboxPtr->setChecked(true);
  209. }
  210. }
  211. else if (check == "KEY6") {
  212. if (handleKeys1Checkbox) {
  213. handleKeys1Checkbox = false;
  214. mHandleKeys1CheckboxPtr->setChecked(false);
  215. }
  216. else {
  217. handleKeys1Checkbox = true;
  218. mHandleKeys1CheckboxPtr->setChecked(true);
  219. }
  220. }
  221. else if (check == "KEY=") {
  222. if (handleKeys2Checkbox) {
  223. handleKeys2Checkbox = false;
  224. mHandleKeys2CheckboxPtr->setChecked(false);
  225. }
  226. else {
  227. handleKeys2Checkbox = true;
  228. mHandleKeys2CheckboxPtr->setChecked(true);
  229. }
  230. }
  231. else if (check == "KEY?") {
  232. if (handleKeys3Checkbox) {
  233. handleKeys3Checkbox = false;
  234. mHandleKeys3CheckboxPtr->setChecked(false);
  235. }
  236. else {
  237. handleKeys3Checkbox = true;
  238. mHandleKeys3CheckboxPtr->setChecked(true);
  239. }
  240. }
  241. else if (check == "KEY7") {
  242. if (sosKeysCheckbox) {
  243. sosKeysCheckbox = false;
  244. mSosKeysCheckboxPtr->setChecked(false);
  245. }
  246. else {
  247. sosKeysCheckbox = true;
  248. mSosKeysCheckboxPtr->setChecked(true);
  249. }
  250. }
  251. else if (check == "KEY@") {
  252. if (sosKeys2Checkbox) {
  253. sosKeys2Checkbox = false;
  254. mSosKeys2CheckboxPtr->setChecked(false);
  255. }
  256. else {
  257. sosKeys2Checkbox = true;
  258. mSosKeys2CheckboxPtr->setChecked(true);
  259. }
  260. }
  261. }
  262. /**
  263. * 注册定时器
  264. * 填充数组用于注册定时器
  265. * 注意:id不能重复
  266. */
  267. static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
  268. //{0, 6000}, //定时器id=0, 时间间隔6秒
  269. //{1, 1000},
  270. };
  271. /**
  272. * 当界面构造时触发
  273. */
  274. static void onUI_init(){
  275. //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
  276. mEditTextDestURIPtr->setText(StoragePreferences::getString(SIP_REG_DOOR_ACCOUNT, SIP_REG_DOOR_ACCOUNT_DEFAULT));
  277. }
  278. /**
  279. * 当切换到该界面时触发
  280. */
  281. static void onUI_intent(const Intent *intentPtr) {
  282. if (intentPtr != NULL) {
  283. //TODO
  284. }
  285. }
  286. /*
  287. * 当界面显示时触发
  288. */
  289. static void onUI_show() {
  290. EASYUICONTEXT->hideNaviBar();
  291. EASYUICONTEXT->hideStatusBar();
  292. setSipTestTheme();
  293. // 切换成SIP模式
  294. StoragePreferences::putString(STORE_SIGNAL_TYPE, "SIP");
  295. }
  296. /*
  297. * 当界面隐藏时触发
  298. */
  299. static void onUI_hide() {
  300. }
  301. /*
  302. * 当界面完全退出时触发
  303. */
  304. static void onUI_quit() {
  305. LOGD(">>>>>>>>>>> sip test quit !!!\n");
  306. EASYUICONTEXT->showStatusBar();
  307. EASYUICONTEXT->showNaviBar();
  308. // 切换回TCP模式
  309. StoragePreferences::putString(STORE_SIGNAL_TYPE, "TCP");
  310. }
  311. /**
  312. * 串口数据回调接口
  313. */
  314. static void onProtocolDataUpdate(const SProtocolData &data) {
  315. }
  316. /**
  317. * 定时器触发函数
  318. * 不建议在此函数中写耗时操作,否则将影响UI刷新
  319. * 参数: id
  320. * 当前所触发定时器的id,与注册时的id相同
  321. * 返回值: true
  322. * 继续运行当前定时器
  323. * false
  324. * 停止运行当前定时器
  325. */
  326. static bool onUI_Timer(int id){
  327. switch (id) {
  328. break;
  329. default:
  330. break;
  331. }
  332. return true;
  333. }
  334. /**
  335. * 有新的触摸事件时触发
  336. * 参数:ev
  337. * 新的触摸事件
  338. * 返回值:true
  339. * 表示该触摸事件在此被拦截,系统不再将此触摸事件传递到控件上
  340. * false
  341. * 触摸事件将继续传递到控件上
  342. */
  343. static bool onsipTestActivityTouchEvent(const MotionEvent &ev) {
  344. switch (ev.mActionStatus) {
  345. case MotionEvent::E_ACTION_DOWN://触摸按下
  346. //LOGD("时刻 = %ld 坐标 x = %d, y = %d", ev.mEventTime, ev.mX, ev.mY);
  347. break;
  348. case MotionEvent::E_ACTION_MOVE://触摸滑动
  349. break;
  350. case MotionEvent::E_ACTION_UP: //触摸抬起
  351. break;
  352. default:
  353. break;
  354. }
  355. return false;
  356. }
  357. static void onEditTextChanged_EditTextDestURI(const std::string &text) {
  358. //LOGD(" onEditTextChanged_ EditTextDestURI %s !!!\n", text.c_str());
  359. StoragePreferences::putString(SIP_REG_DOOR_ACCOUNT, text);
  360. }
  361. static bool onButtonClick_CallButton(ZKButton *pButton) {
  362. LOGD(" ButtonClick CallButton !!!\n");
  363. int port = StoragePreferences::getInt(SIP_REG_PORT, SIP_REG_PORT_DEFAULT);
  364. std::string domain = StoragePreferences::getString(SIP_REG_DOMAIN, SIP_REG_DOMAIN_DEFAULT);
  365. std::string od_number = StoragePreferences::getString(SIP_REG_DOOR_ACCOUNT, SIP_REG_DOOR_ACCOUNT_DEFAULT);
  366. std::string od_number_uri = URI(od_number, domain, port);
  367. LOGD("od_number_uri: %s", od_number_uri.c_str());
  368. voip::CallSetting setting;
  369. setting.enable_video = false;
  370. GetTelephone()->MakeCall(od_number_uri, setting);
  371. return false;
  372. }
  373. static bool onButtonClick_RecordTestButton(ZKButton *pButton) {
  374. LOGD(" ButtonClick RecordTestButton !!!\n");
  375. // 如果线程在运行,则不能重复运行
  376. if(recordTest.isRunning()) {
  377. return false;
  378. }
  379. if(!pButton->isSelected()) {
  380. pButton->setSelected(true);
  381. }
  382. recordTest.Record();
  383. return false;
  384. }
  385. static void onCheckedChanged_SosKeysCheckbox(ZKCheckBox* pCheckBox, bool isChecked) {
  386. LOGD(" Checkbox SosKeysCheckbox checked %d", isChecked);
  387. }
  388. static void onCheckedChanged_HandleKeys2Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  389. LOGD(" Checkbox HandleKeys2Checkbox checked %d", isChecked);
  390. }
  391. static void onCheckedChanged_PanelKeys3Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  392. LOGD(" Checkbox PanelKeys3Checkbox checked %d", isChecked);
  393. }
  394. static void onCheckedChanged_HandleKeys3Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  395. LOGD(" Checkbox HandleKeys3Checkbox checked %d", isChecked);
  396. }
  397. static void onCheckedChanged_SosKeys2Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  398. LOGD(" Checkbox SosKeys2Checkbox checked %d", isChecked);
  399. }
  400. static void onCheckedChanged_PanelKeys4Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  401. LOGD(" Checkbox PanelKeys4Checkbox checked %d", isChecked);
  402. }
  403. static void onCheckedChanged_PanelKeys2Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  404. LOGD(" Checkbox PanelKeys2Checkbox checked %d", isChecked);
  405. }
  406. static void onCheckedChanged_PanelKeys1Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  407. LOGD(" Checkbox PanelKeys1Checkbox checked %d", isChecked);
  408. }
  409. static void onCheckedChanged_HandleKeys1Checkbox(ZKCheckBox* pCheckBox, bool isChecked) {
  410. LOGD(" Checkbox HandleKeys1Checkbox checked %d", isChecked);
  411. }
  412. static bool onButtonClick_sip_back(ZKButton *pButton) {
  413. LOGD(" ButtonClick sip_back !!!\n");
  414. EASYUICONTEXT->goBack();
  415. return false;
  416. }
  417. static void onCheckedChanged_PanelCancelKeysCheckbox(ZKCheckBox* pCheckBox, bool isChecked) {
  418. LOGD(" Checkbox PanelCancelKeysCheckbox checked %d", isChecked);
  419. }
  420. static bool onButtonClick_ColorTestButton(ZKButton *pButton) {
  421. LOGD(" ButtonClick ColorTestButton !!!\n");
  422. EASYUICONTEXT->openActivity("colorActivity");
  423. return false;
  424. }
  425. static int doorLignt = 0;
  426. static bool onButtonClick_DoorLightTestButton(ZKButton *pButton) {
  427. LOGD(" ButtonClick DoorLightTestButton !!!\n");
  428. doorLignt += 1;
  429. if (doorLignt == 1) {
  430. lightControl("DOORLED", "100F");
  431. }
  432. else if (doorLignt == 2) {
  433. lightControl("DOORLED", "200F");
  434. }
  435. else if (doorLignt == 3) {
  436. lightControl("DOORLED", "010F");
  437. }
  438. else if (doorLignt == 4) {
  439. lightControl("DOORLED", "020F");
  440. }
  441. else if (doorLignt == 5) {
  442. lightControl("DOORLED", "001F");
  443. }
  444. else if (doorLignt == 6) {
  445. lightControl("DOORLED", "002F");
  446. }
  447. else if (doorLignt == 7) {
  448. lightControl("DOORLED", "110F");
  449. }
  450. else if (doorLignt == 8) {
  451. lightControl("DOORLED", "220F");
  452. }
  453. else if (doorLignt == 9) {
  454. lightControl("DOORLED", "101F");
  455. }
  456. else if (doorLignt == 10) {
  457. lightControl("DOORLED", "202F");
  458. }
  459. else if (doorLignt == 11) {
  460. lightControl("DOORLED", "011F");
  461. }
  462. else if (doorLignt == 12) {
  463. lightControl("DOORLED", "022F");
  464. }
  465. else if (doorLignt == 13) {
  466. lightControl("DOORLED", "111F");
  467. }
  468. else if (doorLignt == 14) {
  469. lightControl("DOORLED", "222F");
  470. }
  471. else if (doorLignt == 15) {
  472. lightControl("DOORLED", "000F");
  473. doorLignt = 0;
  474. }
  475. return false;
  476. }