Commit 75c123348de8ed13f44323d5ddc22d7def5f8b59
1 parent
b326dd65
add net_services_protocols folder and pkg_updater_protocol.anubis
Showing
3 changed files
with
44 additions
and
4 deletions
Show diff stats
calexium_lib/CXM_message_constants.anubis
| ... | ... | @@ -33,6 +33,7 @@ public define Int32 _CXM_REQUEST_FOR_SERVICE = 0x33770C01. // |
| 33 | 33 | |
| 34 | 34 | public define Int32 _CXM_GENERIC_PROTOCOL_BASIS = 0x33771000. // |
| 35 | 35 | public define Int32 _CXM_ACK = 0x33771001. // |
| 36 | +public define Int32 _CXM_ACK_RESULT_MSG = 0x33771002. // | |
| 36 | 37 | |
| 37 | 38 | // **************** FTP SERVICE *************** |
| 38 | 39 | ... | ... |
calexium_lib/net_services/CXM_generic_protocol.anubis
| ... | ... | @@ -24,8 +24,8 @@ public define One |
| 24 | 24 | Int32 cmd_id |
| 25 | 25 | )= |
| 26 | 26 | with err_msg = message(_CXM_ACK), |
| 27 | - forget(add_int32(err_msg, "_CMD", cmd_id)); | |
| 28 | - forget(add_int32(err_msg, "_STATUS", _CXM_ERROR)); | |
| 27 | + forget(add_int32(err_msg, "CMD", cmd_id)); | |
| 28 | + forget(add_int32(err_msg, "STATUS", _CXM_ERROR)); | |
| 29 | 29 | forget(send_message_by_Stream(conn, err_msg)) |
| 30 | 30 | . |
| 31 | 31 | |
| ... | ... | @@ -36,10 +36,38 @@ public define One |
| 36 | 36 | Int32 cmd_id |
| 37 | 37 | )= |
| 38 | 38 | with ok_msg = message(_CXM_ACK), |
| 39 | - forget(add_int32(ok_msg, "_CMD", cmd_id)); | |
| 40 | - forget(add_int32(ok_msg, "_STATUS", _CXM_OK)); | |
| 39 | + forget(add_int32(ok_msg, "CMD", cmd_id)); | |
| 40 | + forget(add_int32(ok_msg, "STATUS", _CXM_OK)); | |
| 41 | 41 | forget(send_message_by_Stream(conn, ok_msg)) |
| 42 | 42 | . |
| 43 | + | |
| 44 | +public define One | |
| 45 | + send_ACK_ok | |
| 46 | + ( | |
| 47 | + RWStream conn, | |
| 48 | + Int32 cmd_id, | |
| 49 | + Message result | |
| 50 | + )= | |
| 51 | + with ok_msg = message(_CXM_ACK), | |
| 52 | + forget(add_int32(ok_msg, "CMD", cmd_id)); | |
| 53 | + forget(add_int32(ok_msg, "STATUS", _CXM_OK)); | |
| 54 | + forget(add_message(ok_msg, "RESULT", result)); | |
| 55 | + forget(send_message_by_Stream(conn, ok_msg)) | |
| 56 | + . | |
| 57 | + | |
| 58 | +public define One | |
| 59 | + send_result | |
| 60 | + ( | |
| 61 | + RWStream conn, | |
| 62 | + Int32 cmd_id, | |
| 63 | + Maybe(Message) mb_msg | |
| 64 | + )= | |
| 65 | + if mb_msg is | |
| 66 | + { | |
| 67 | + failure then send_ACK_error(conn, cmd_id), | |
| 68 | + success(msg) then send_ACK_ok(conn, cmd_id, msg) | |
| 69 | + } | |
| 70 | + . | |
| 43 | 71 | |
| 44 | 72 | public define Maybe(Message) |
| 45 | 73 | wait_for_reply | ... | ... |
calexium_lib/net_services_protocols/pkg_updater_protocol.anubis
0 → 100644