- Timestamp:
- Jan 8, 2016, 2:35:52 PM (7 years ago)
- Location:
- uKadecot/trunk
- Files:
-
- 1 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/kadecot/wamp_broker.c
r108 r148 90 90 91 91 subscription = wamp_broker_new_subscription(broker); 92 if(subscription == NULL) 93 return; 92 94 93 95 subscription->deviceName[0] = '\0'; -
uKadecot/trunk/src/ukadecot/main.c
r125 r148 274 274 static void main_publish(T_EDATA *esv); 275 275 276 enum main_state_t { 277 main_state_start, 278 main_state_idle, 279 }; 280 281 TMO main_timer = TMO_FEVR; 282 enum main_state_t main_state = main_state_start; 276 283 struct pt main_pt; 277 284 struct uip_timer main_pt_timer; … … 294 301 295 302 /* 初期化 */ 296 main_initialize(); 303 if (main_state == main_state_start) 304 main_initialize(); 297 305 298 306 ret2 = get_tim(&now); … … 334 342 ret = ecn_rel_esv(esv); 335 343 if (ret != E_OK){ 336 syslog(LOG_ERROR, " ecn_rel_esv");344 syslog(LOG_ERROR, "ECNL ecn_rel_esv result = %d", ret); 337 345 PT_EXIT(&main_pt); 338 346 } … … 366 374 ret = ecn_rel_esv(esv); 367 375 if (ret != E_OK){ 368 syslog(LOG_ERROR, " ecn_rel_esv");376 syslog(LOG_ERROR, "BRK ecn_rel_esv msg = %p, type = %d, result = %d", esv, msg.ptr->hdr.type, ret); 369 377 PT_EXIT(&main_pt); 370 378 } … … 392 400 } 393 401 394 enum main_state_t {395 main_state_start,396 main_state_idle,397 };398 399 TMO main_timer = TMO_FEVR;400 enum main_state_t main_state = main_state_start;401 402 bool_t main_btn1_state; 402 403 int main_btn1_count = 0; -
uKadecot/trunk/src/ukadecot/main.h
r108 r148 55 55 */ 56 56 57 #define MAIN_PRIORITY 7/* メインタスクの優先度 */57 #define MAIN_PRIORITY 3 /* メインタスクの優先度 */ 58 58 #define INIT_PRIORITY 1 /* 初期化タスクの優先度 */ 59 59 #define LOGTASK_PRIORITY 8 /* ログタスクの優先度 */ -
uKadecot/trunk/src/ukadecot/uip_app_config.h
r108 r148 45 45 */ 46 46 47 #define UIP_TASK_PRIORITY 347 #define UIP_TASK_PRIORITY 7 48 48 #define UIP_TASK_STACK_SIZE 256 49 49 -
uKadecot/trunk/tools/EcnlControllerUI/EcnlControllerUI/Control.cs
r108 r148 764 764 765 765 private Type InputType { get { return FieldContain.Input.GetType(); } } 766 766 767 private byte[] ToByteValue() 767 768 { … … 935 936 /// </summary> 936 937 public bool Changed { get { return !FieldContain.Input.Value.Equals(ToText(GetValue)); } } 938 937 939 public void GrpBoxChange(Element ele, jQueryEvent ev) 938 940 { … … 946 948 947 949 public EventHandlerDevicePropertyInfo KadecotSet; 950 948 951 public void SetGetValue(byte[] data) 949 952 { … … 1110 1113 public Icon ButtonIcon { get { return getIcon(); } set { base.Object.ToggleClass(getClass(value), true); } } 1111 1114 public string Href { get { return base.Object.GetAttribute("href"); } set { base.Object.Attribute("href", value); } } 1115 1112 1116 public enum Icon 1113 1117 { … … 1237 1241 public List<RadioInput> RadioList; 1238 1242 private bool _ControlGroup; 1243 1239 1244 public bool ControlGroup 1240 1245 { … … 1256 1261 1257 1262 private bool _Horizontal; 1263 1258 1264 public bool Horizontal 1259 1265 { … … 1275 1281 public UIRadioInput Radio; 1276 1282 public UILabel Label; 1283 1277 1284 public RadioInput(UILabel Label, UIRadioInput Radio) 1278 1285 { … … 1413 1420 1414 1421 public string Placeholder { get { return base.GetAttribute("placeholder"); } set { base.Attribute("placeholder", value); } } 1422 1415 1423 public JsDictionary DataOptions 1416 1424 { … … 1572 1580 : base("<li>") 1573 1581 { 1574 1575 1582 } 1576 1583 … … 1634 1641 : base("<a>") 1635 1642 { 1636 1637 1643 } 1638 1644 … … 1663 1669 : base("<h" + i.ToString() + ">") 1664 1670 { 1665 1666 1671 } 1667 1672 … … 1678 1683 : base("<img>") 1679 1684 { 1680 1681 1685 } 1682 1686 … … 1826 1830 { 1827 1831 public DeviceController DeviceController; 1832 1828 1833 public class UIDeviceInfo 1829 1834 { … … 2000 2005 info = new UIDiv(); 2001 2006 string identifer = ""; 2007 2002 2008 foreach (var node in NodeList) { 2003 2004 2009 var profile = node.Profile; 2005 2010 2006 2011 if (jQuery.Select("#" + "cl_node_" + identifer).Length > 0) 2007 2012 continue; 2013 2008 2014 UICollapsibleset col = new UICollapsibleset(node.Data.ToString()); 2009 2015 col.Id = "cl_node_" + identifer; … … 2013 2019 2014 2020 col.Append(listview); 2021 2015 2022 foreach (var item in node.Devices) { 2016 2017 2023 if (item.Profile) 2018 2024 continue; … … 2063 2069 public static string LoadingShow = "loading.show"; 2064 2070 public static string LoadingHide = "loading.hide"; 2065 /// <summary> 2066 /// 機器検索開始 2067 /// </summary> 2071 /// <summary>機器検索開始</summary> 2068 2072 public static string SearchStart = "search.start"; 2069 /// <summary> 2070 /// 機器検索終了 2071 /// </summary> 2073 /// <summary>機器検索終了</summary> 2072 2074 public static string SearchEnd = "search.end"; 2073 /// <summary> 2074 /// 機器検索エラー 2075 /// </summary> 2075 /// <summary>機器検索エラー</summary> 2076 2076 public static string SearchError = "search.error"; 2077 /// <summary> 2078 /// 入力画面作成開始 2079 /// </summary> 2077 /// <summary>入力画面作成開始</summary> 2080 2078 public static string PropertyWriteStart = "propertywrite.start"; 2081 /// <summary> 2082 /// 入力画面作成終了 2083 /// </summary> 2079 /// <summary>入力画面作成終了</summary> 2084 2080 public static string PropertyWriteEnd = "propertywrite.end"; 2085 2081 } -
uKadecot/trunk/tools/EcnlControllerUI/EcnlControllerUI/WampClient.cs
r108 r148 491 491 492 492 //deserialize 493 if (msg.data != null) { 494 data = WampDeserializer.Parse(msg.data); 495 } 496 else { 497 data = WampDeserializer.Parse((string)msg); 493 try { 494 if (msg.data != null) { 495 data = WampDeserializer.Parse(msg.data); 496 } 497 else { 498 data = WampDeserializer.Parse((string)msg); 499 } 500 } 501 catch { 502 data = null; 498 503 } 499 504 if (data == null) { -
uKadecot/trunk/tools/EcnlControllerUI/EcnlCtrlUI/js/ctrlui.js
r125 r148 5314 5314 //decrypt data 5315 5315 //deserialize 5316 if (!!ss.isValue(msg.data)) { 5317 data = $Kadecot_WampDeserializer.parse(ss.cast(msg.data, String)); 5318 } 5319 else { 5320 data = $Kadecot_WampDeserializer.parse(ss.cast(msg, String)); 5316 try { 5317 if (!!ss.isValue(msg.data)) { 5318 data = $Kadecot_WampDeserializer.parse(ss.cast(msg.data, String)); 5319 } 5320 else { 5321 data = $Kadecot_WampDeserializer.parse(ss.cast(msg, String)); 5322 } 5323 } 5324 catch ($t1) { 5325 data = null; 5321 5326 } 5322 5327 if (ss.isNullOrUndefined(data)) { -
uKadecot/trunk/tools/EcnlControllerUI/EcnlCtrlUI/js/ctrlui.min.js
r125 r148 425 425 else{return null;} 426 426 return data;},sendYield:function(request,options,arguments1,argumentsKw){var data;data=$Kadecot_WampSerializer.createYield(request,options,arguments1,argumentsKw);if(this.$on_open_flag){this.$webSocket.send(data);} 427 return data;},onOpen:function(e){this.$on_open_flag=true;var callback=this.$wampClientCore.get_openCallback();if(!ss.staticEquals(callback,null)){callback();}},onClose:function(e){this.$on_open_flag=false;var callback=this.$wampClientCore.get_closeCallback();if(!ss.staticEquals(callback,null)){callback();}},onError:function(e){var eea=e;if(!ss.staticEquals(this.$errorCallback,null)){this.$errorCallback(ss.cast(eea.message,String));}},onMessage:function(e){var msg=e;var data;var callback=null;if(!!ss.isValue(msg.data)){data=$Kadecot_WampDeserializer.parse(ss.cast(msg.data,String));} 428 else{data=$Kadecot_WampDeserializer.parse(ss.cast(msg,String));} 427 return data;},onOpen:function(e){this.$on_open_flag=true;var callback=this.$wampClientCore.get_openCallback();if(!ss.staticEquals(callback,null)){callback();}},onClose:function(e){this.$on_open_flag=false;var callback=this.$wampClientCore.get_closeCallback();if(!ss.staticEquals(callback,null)){callback();}},onError:function(e){var eea=e;if(!ss.staticEquals(this.$errorCallback,null)){this.$errorCallback(ss.cast(eea.message,String));}},onMessage:function(e){var msg=e;var data;var callback=null;try{if(!!ss.isValue(msg.data)){data=$Kadecot_WampDeserializer.parse(ss.cast(msg.data,String));} 428 else{data=$Kadecot_WampDeserializer.parse(ss.cast(msg,String));}} 429 catch($t1){data=null;} 429 430 if(ss.isNullOrUndefined(data)){return;} 430 431 var list=ss.cast(data,Array);var switchData=ss.unbox(ss.cast(list[0],ss.Int32));switch(switchData){case 2:{if(this.$challnge_flag){this.$challnge_flag=false;callback=this.$wampClientCore.get_authenticateCallback();if(!ss.staticEquals(callback,null)){callback(data);} -
uKadecot/trunk/uip/apps/webserver/websocket.c
r108 r148 127 127 // Payload buffer 128 128 default: 129 _ecn_fbs_poke(ws->cur_in_msg, s->data_pos, *pos ^ s->masking_key[s->data_pos % 4]); 129 if(ws->cur_in_msg.ptr != NULL) 130 _ecn_fbs_poke(ws->cur_in_msg, s->data_pos, *pos ^ s->masking_key[s->data_pos % 4]); 130 131 131 132 s->data_pos++; … … 133 134 ER ret; 134 135 s->state = 0; 135 ((ID *)ws->cur_in_msg.ptr->_gap)[0] = ws->wbsid; 136 ret = psnd_dtq(ecn_api_mailboxid, (intptr_t)ws->cur_in_msg.ptr); 137 if (ret != E_OK) { 138 syslog(LOG_WARNING, "websocket_input() : psnd_dtq(%d) result = %d", ecn_api_mailboxid, ret); 139 _ecn_fbs_del(ws->cur_in_msg); 136 137 if (ws->cur_in_msg.ptr != NULL) { 138 ((ID *)ws->cur_in_msg.ptr->_gap)[0] = ws->wbsid; 139 ret = psnd_dtq(ecn_api_mailboxid, (intptr_t)ws->cur_in_msg.ptr); 140 if (ret != E_OK) { 141 syslog(LOG_WARNING, "websocket_input() : psnd_dtq(%d) result = %d", ecn_api_mailboxid, ret); 142 _ecn_fbs_del(ws->cur_in_msg); 143 } 140 144 } 141 145 memset(&ws->cur_in_msg, 0, sizeof(ws->cur_in_msg)); -
uKadecot/trunk/uip/target/if_rx62n/if_rx62n.c
r108 r148 378 378 */ 379 379 380 void 380 bool_t 381 381 rx62n_start (T_IF_SOFTC *ic, void *output, int size) 382 382 { … … 391 391 392 392 if (desc->tact != 0) { 393 break;393 return false; 394 394 } 395 395 … … 423 423 sil_wrw_mem(EDMAC_EDTRR, EDMAC_EDTRR_TR); 424 424 } 425 426 return true; 425 427 } 426 428 … … 435 437 T_RX62N_SOFTC *sc; 436 438 uint32_t ecsr, eesr, psr; 437 bool_t acttsk ;439 bool_t acttsk = false; 438 440 439 441 i_begin_int(INTNO_IF_RX62N_TRX); -
uKadecot/trunk/uip/target/if_rx62n/if_rx62n.h
r108 r148 60 60 */ 61 61 62 #define NUM_IF_RX62N_TXBUF 8/* 送信バッファ数 */62 #define NUM_IF_RX62N_TXBUF 2 /* 送信バッファ数 */ 63 63 #define NUM_IF_RX62N_RXBUF 8 /* 受信バッファ数 */ 64 64 #define IF_RX62N_BUF_PAGE_SIZE 1518 /* バッファサイズ */ … … 120 120 extern bool_t rx62n_link(T_IF_SOFTC *ic); 121 121 extern int rx62n_read(T_IF_SOFTC *ic, void **input); 122 extern voidrx62n_start(T_IF_SOFTC *ic, void *output, int size);122 extern bool_t rx62n_start(T_IF_SOFTC *ic, void *output, int size); 123 123 extern ER rx62n_addmulti(T_IF_SOFTC *ic); 124 124 extern void if_rx62n_trx_handler(void); -
uKadecot/trunk/uip/task/uip_task.c
r125 r148 98 98 T_IF_SOFTC *ic = IF_ETHER_NIC_GET_SOFTC(); 99 99 int ret; 100 bool_t tx; 100 101 101 102 PT_BEGIN(&uiptsk->pt); … … 124 125 125 126 PT_WAIT_UNTIL(&uiptsk->pt, (ret = ic->link_pre != ic->link_now ? 1 : 126 (ic->rxb_read != ic->rxb_write ? 2 :127 127 (uip_out_buf[uip_out_rpos].len > 0 ? 3 : 128 128 (ws_out_req != ws_out_res ? 4 : 129 (timer_expired(&uiptsk->periodic_timer) ? 5 : 0))))) != 0); 129 (timer_expired(&uiptsk->periodic_timer) ? 5 : 130 (ic->rxb_read != ic->rxb_write ? 2 : 0))))) != 0); 130 131 131 132 if(ret == 1){ … … 146 147 if (uip_len > 0) { 147 148 uip_arp_out(); 148 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 149 for (;;) { 150 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 151 if (tx) 152 break; 153 PT_YIELD(&uiptsk->pt); 154 } 149 155 } 150 156 } … … 174 180 if (uip_len > 0) { 175 181 uip_arp_out(); 176 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 182 for (;;) { 183 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 184 if (tx) 185 break; 186 PT_YIELD(&uiptsk->pt); 187 } 177 188 PT_YIELD(&uiptsk->pt); 178 189 continue; … … 185 196 uip_len is set to a value > 0. */ 186 197 if (uip_len > 0) { 187 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 198 for (;;) { 199 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 200 if (tx) 201 break; 202 PT_YIELD(&uiptsk->pt); 203 } 188 204 PT_YIELD(&uiptsk->pt); 189 205 continue; … … 204 220 uip_udp_send(buf->len); 205 221 206 buf->len = 0;207 uip_out_rpos++;208 if (uip_out_rpos >= UIP_BUF_COUNT)209 uip_out_rpos = 0;210 211 222 uip_udp_conn = cepid; 212 223 uip_process(UIP_UDP_SEND_CONN); … … 214 225 cepid->rport = 0; 215 226 uip_arp_out(); 216 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 227 for (;;) { 228 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 229 if (tx) 230 break; 231 PT_YIELD(&uiptsk->pt); 232 } 233 234 buf = &uip_out_buf[uip_out_rpos]; 235 uip_out_rpos++; 236 if (uip_out_rpos >= UIP_BUF_COUNT) 237 uip_out_rpos = 0; 238 buf->len = 0; 239 217 240 PT_YIELD(&uiptsk->pt); 218 241 continue; … … 231 254 if (uip_len > 0) { 232 255 uip_arp_out(); 233 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 256 for (;;) { 257 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 258 if (tx) 259 break; 260 PT_YIELD(&uiptsk->pt); 261 } 234 262 PT_YIELD(&uiptsk->pt); 235 263 } … … 247 275 if (uip_len > 0) { 248 276 uip_arp_out(); 249 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 277 for (;;) { 278 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 279 if (tx) 280 break; 281 PT_YIELD(&uiptsk->pt); 282 } 250 283 PT_YIELD(&uiptsk->pt); 251 284 } … … 261 294 if (uip_len > 0) { 262 295 uip_arp_out(); 263 IF_ETHER_NIC_START(ic, uip_buf, uip_len); 296 for (;;) { 297 tx = IF_ETHER_NIC_START(ic, uip_buf, uip_len); 298 if (tx) 299 break; 300 PT_YIELD(&uiptsk->pt); 301 } 264 302 PT_YIELD(&uiptsk->pt); 265 303 }
Note:
See TracChangeset
for help on using the changeset viewer.