* move forward_at_cmd_resp into InfosG3P class - the variable is shared between the two connections of an inverter. One is for the TSUN cloud and the other for the device. * use inverter class to share values between the two protocol instances of a proxy - move forward_at_cmd_resp into class InverterG3P - store inverter ptr in Solarman_V5 instances - add inverter ptr to all constructurs of protocols - adapt doku and unit tests- - add integration tests for AT+ commands which check the forwarding from and to the TSUN cloud * adapt and improve the unit tests - fix node_id declaration, which always has a / at the end. See config grammar for this rule - set global var test to default after test run
44 lines
2.4 KiB
Plaintext
44 lines
2.4 KiB
Plaintext
// {type:class}
|
|
// {direction:topDown}
|
|
// {generate:true}
|
|
|
|
[note: Example of instantiation for a GEN3 inverter!{bg:cornsilk}]
|
|
[<<AbstractIterMeta>>||__iter__()]
|
|
|
|
[InverterBase|addr;remote:StreamPtr;local:StreamPtr|create_remote();;close()]
|
|
[InverterBase]^[InverterG3]
|
|
[InverterBase]++->[local:StreamPtr]
|
|
[InverterBase]++->[remote:StreamPtr]
|
|
[<<AsyncIfc>>||set_node_id();get_conn_no();;tx_add();tx_flush();tx_get();tx_peek();tx_log();tx_clear();tx_len();;fwd_add();fwd_log();rx_get();rx_peek();rx_log();rx_clear();rx_len();rx_set_cb();;prot_set_timeout_cb()]
|
|
[AsyncIfcImpl|fwd_fifo:ByteFifo;tx_fifo:ByteFifo;rx_fifo:ByteFifo;conn_no:Count;node_id;timeout_cb]
|
|
[AsyncStream|reader;writer;addr;r_addr;l_addr|;<async>loop;disc();close();healthy();;__async_read();__async_write();__async_forward()]
|
|
[AsyncStreamServer|create_remote|<async>server_loop();<async>_async_forward();<async>publish_outstanding_mqtt();close()]
|
|
[AsyncStreamClient||<async>client_loop();<async>_async_forward())]
|
|
[<<AsyncIfc>>]^-.-[AsyncIfcImpl]
|
|
[AsyncIfcImpl]^[AsyncStream]
|
|
[AsyncStream]^[AsyncStreamServer]
|
|
[AsyncStream]^[AsyncStreamClient]
|
|
|
|
|
|
[Talent|conn_no;addr;;await_conn_resp_cnt;id_str;contact_name;contact_mail;db:InfosG3;mb:Modbus;switch|msg_contact_info();msg_ota_update();msg_get_time();msg_collector_data();msg_inverter_data();msg_unknown();;healthy();close()]
|
|
[Talent]<-++[local:StreamPtr]
|
|
[local:StreamPtr]++->[AsyncStreamServer]
|
|
[Talent]<-0..1[remote:StreamPtr]
|
|
[remote:StreamPtr]0..1->[AsyncStreamClient]
|
|
|
|
[Infos|stat;new_stat_data;info_dev|static_init();dev_value();inc_counter();dec_counter();ha_proxy_conf;ha_conf;ha_remove;update_db;set_db_def_value;get_db_value;ignore_this_device]
|
|
[Infos]^[InfosG3||ha_confs();parse()]
|
|
|
|
[Talent]->[InfosG3]
|
|
|
|
[Message|server_side:bool;mb:Modbus;ifc:AsyncIfc;node_id;header_valid:bool;header_len;data_len;unique_id;sug_area:str;new_data:dict;state:State;shutdown_started:bool;modbus_elms;mb_timer:Timer;mb_timeout;mb_first_timeout;modbus_polling:bool|_set_mqtt_timestamp();_timeout();_send_modbus_cmd();<async> end_modbus_cmd();close();inc_counter();dec_counter()]
|
|
[Message]use->[<<AsyncIfc>>]
|
|
|
|
[<<ProtocolIfc>>|_registry|close()]
|
|
[<<AbstractIterMeta>>]^-.-[<<ProtocolIfc>>]
|
|
[<<ProtocolIfc>>]^-.-[Message]
|
|
[Message]^[Talent]
|
|
|
|
[Modbus|que;;snd_handler;rsp_handler;timeout;max_retires;last_xxx;err;retry_cnt;req_pend;tim|build_msg();recv_req();recv_resp();close()]
|
|
[Modbus]<0..1-has[Message]
|