Refactor set SDK connection message constructor

This commit is contained in:
2023-02-02 01:14:29 -06:00
parent 9ccc5cbca0
commit 3a0656f4c4
2 changed files with 24 additions and 10 deletions
+13 -5
View File
@@ -49,13 +49,21 @@ message_new(struct Client* session, uint8_t cmdset, uint8_t cmdid, size_t length
// public
const Message
set_sdk_connection_req_new (
set_sdk_connection_req_new(
Client session,
struct SetSdkConnectionReq* msg ) {
enum CONNECTION connection_type,
uint32_t ip_address,
uint16_t port ) {
msg->host = session->hostbyte;
struct Message* message = message_new(session, 0x3F, SET_SDK_CONNECTION_CMDID, sizeof(struct SetSdkConnectionReq), msg);
return message;
const struct SetSdkConnectionReq msg = {
0,
session->hostbyte,
connection_type,
0,
ip_address,
port
};
return message_new(session, 0x3F, SET_SDK_CONNECTION_CMDID, sizeof(msg), &msg);
}
const Message