renamed mc_sml_optional_write to
sml_buf_optional_write
This commit is contained in:
parent
98173c0d1b
commit
f6a9c978ba
11 changed files with 27 additions and 27 deletions
|
@ -96,7 +96,7 @@ unsigned char sml_buf_get_current_byte(sml_buffer *buf);
|
|||
// Returns a pointer to the current buffer position.
|
||||
unsigned char *sml_buf_get_current_buf(sml_buffer *buf);
|
||||
|
||||
void mc_sml_optional_write(sml_buffer *buf);
|
||||
void sml_buf_optional_write(sml_buffer *buf);
|
||||
|
||||
// Sets the number of bytes read (moves the cursor forward)
|
||||
void mc_sml_buf_update_read_bytes(sml_buffer *buf, int bytes);
|
||||
|
|
|
@ -32,7 +32,7 @@ void sml_close_request_write(sml_close_request *msg, sml_buffer *buf) {
|
|||
|
||||
if (msg->global_signature != NULL){
|
||||
sml_octet_string_write(msg->global_signature,buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
}
|
||||
|
||||
sml_close_request * sml_close_request_parse(sml_buffer *buf) {
|
||||
|
|
|
@ -35,22 +35,22 @@ void sml_get_list_request_write(sml_get_list_request *msg, sml_buffer *buf) {
|
|||
// optional server_id
|
||||
if (msg->server_id != NULL){
|
||||
sml_octet_string_write(msg->server_id, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// optional username
|
||||
if (msg->username != NULL){
|
||||
sml_octet_string_write(msg->username, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// optional password
|
||||
if (msg->password != NULL){
|
||||
sml_octet_string_write(msg->password, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// optional list_name
|
||||
if (msg->list_name != NULL){
|
||||
sml_octet_string_write(msg->list_name,buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,17 +34,17 @@ void sml_get_proc_parameter_request_write(sml_get_proc_parameter_request *msg, s
|
|||
// optional server_id
|
||||
if (msg->server_id != NULL){
|
||||
sml_octet_string_write(msg->server_id, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// optional username
|
||||
if (msg->username != NULL) {
|
||||
sml_octet_string_write(msg->username, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// optional password
|
||||
if (msg->password != NULL){
|
||||
sml_octet_string_write(msg->password, buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
sml_tree_path_write(msg->parameter_tree_path, buf);
|
||||
|
||||
|
|
|
@ -38,35 +38,35 @@ void sml_get_profile_pack_request_write(sml_get_profile_pack_request *msg, sml_b
|
|||
// server_id
|
||||
if (msg->server_id != NULL) {
|
||||
sml_octet_string_write(msg->server_id,buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// username
|
||||
if (msg->username != NULL) {
|
||||
sml_octet_string_write(msg->username,buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// password
|
||||
if (msg->password != NULL) {
|
||||
sml_octet_string_write(msg->password,buf);
|
||||
} else mc_sml_optional_write(buf);
|
||||
} else sml_buf_optional_write(buf);
|
||||
|
||||
// with_rawdata
|
||||
if (msg->with_rawdata != NULL) {
|
||||
printf("TODO: %s - comparision is not valid", __FUNCTION__);
|
||||
sml_boolean_write(msg->with_rawdata,buf);
|
||||
} else mc_sml_optional_write(buf); // with_rawdata
|
||||
} else sml_buf_optional_write(buf); // with_rawdata
|
||||
|
||||
// begin_time
|
||||
if (msg->begin_time != NULL){
|
||||
sml_time_write(msg->begin_time, buf);
|
||||
} else mc_sml_optional_write(buf); // begin_time
|
||||
mc_sml_optional_write(buf); // end_time
|
||||
} else sml_buf_optional_write(buf); // begin_time
|
||||
sml_buf_optional_write(buf); // end_time
|
||||
|
||||
// parameter_tree_path is not optional
|
||||
sml_tree_path_write(msg->parameter_tree_path, buf);
|
||||
|
||||
mc_sml_optional_write(buf); // object_list
|
||||
mc_sml_optional_write(buf); // das_details
|
||||
sml_buf_optional_write(buf); // object_list
|
||||
sml_buf_optional_write(buf); // das_details
|
||||
printf("request_write");
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ error:
|
|||
|
||||
void sml_list_write(sml_list *list, sml_buffer *buf){
|
||||
sml_buf_set_type_and_length(buf, SML_TYPE_LIST, 1);
|
||||
mc_sml_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
//
|
||||
}
|
||||
|
||||
|
|
|
@ -58,13 +58,13 @@ sml_open_request *sml_open_request_init() {
|
|||
void sml_open_request_write(sml_open_request *msg, sml_buffer *buf) {
|
||||
sml_buf_set_type_and_length(buf, SML_TYPE_LIST, 7);
|
||||
|
||||
mc_sml_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
sml_octet_string_write(msg->client_id, buf);
|
||||
sml_octet_string_write(msg->req_file_id, buf);
|
||||
sml_octet_string_write(msg->server_id, buf);
|
||||
sml_octet_string_write(msg->username,buf);
|
||||
sml_octet_string_write(msg->password,buf);
|
||||
mc_sml_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ sml_set_proc_parameter_request *sml_set_proc_parameter_request_init() {
|
|||
|
||||
void sml_set_proc_parameter_request_write(sml_set_proc_parameter_request *msg, sml_buffer *buf) {
|
||||
sml_buf_set_type_and_length(buf, SML_TYPE_LIST, 5);
|
||||
mc_sml_optional_write(buf);
|
||||
mc_sml_optional_write(buf);
|
||||
mc_sml_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
sml_tree_path_write(msg->parameter_tree_path, buf);
|
||||
sml_tree_write(msg->parameter_tree, buf);
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ sml_buffer *sml_buffer_init(size_t length) {
|
|||
return buf;
|
||||
}
|
||||
|
||||
void mc_sml_optional_write(sml_buffer *buf) {
|
||||
void sml_buf_optional_write(sml_buffer *buf) {
|
||||
buf->buffer[buf->cursor] = SML_OPTIONAL_SKIPPED;
|
||||
buf->cursor++;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ error:
|
|||
|
||||
void sml_time_write(sml_time *time, sml_buffer *buf){
|
||||
printf("NYI: %s (writing optional flag instead)\n", __FUNCTION__);
|
||||
mc_sml_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
}
|
||||
|
||||
void sml_time_free(sml_time *time) {
|
||||
|
|
|
@ -69,8 +69,8 @@ void sml_tree_write(sml_tree *tree, sml_buffer *buf) {
|
|||
sml_octet_string_write(tree->parameter_name, buf);
|
||||
// TODO
|
||||
sml_proc_par_value_write(tree->parameter_value, buf);
|
||||
//mc_sml_optional_write(buf);
|
||||
mc_sml_optional_write(buf);
|
||||
//sml_buf_optional_write(buf);
|
||||
sml_buf_optional_write(buf);
|
||||
}
|
||||
|
||||
sml_proc_par_value *sml_proc_par_value_init(u8 tag, void *data) {
|
||||
|
|
Loading…
Add table
Reference in a new issue