Refactor set SDK connection message constructor
This commit is contained in:
+13
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user