Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compiler warning and add option to control systemd service file installation #291

Merged
merged 3 commits into from
Sep 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ option (WITH_ERBIUM "Enable Erbium CoAP support)" ON)
option (WITH_GNUTLS "Enable GnuTLS DTLS support" OFF)
option (WITH_CYASSL "Enable CyaSSL DTLS support" OFF)
option (WITH_TINYDTLS "Enable TinyDTLS DTLS support" OFF)
option (WITH_SYSTEMD "Install systemd service files" OFF)

if (WITH_LIBCOAP)
message (WARNING "Disabling erbium support")
Expand Down Expand Up @@ -73,7 +74,9 @@ add_subdirectory (api)
add_subdirectory (tools)

# install systemd files
install (
DIRECTORY systemd/
DESTINATION /
)
if (WITH_SYSTEMD)
install (
DIRECTORY systemd/
DESTINATION /
)
endif ()
8 changes: 6 additions & 2 deletions core/src/common/lwm2m_tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,16 @@ static int TlvEncodeFloat(uint8_t * buffer, int bufferLen, int type, int id, dou
if (floatSize == 4)
{
float f = value;
int32_t temp = htonl(*(uint32_t*)&f);
int32_t temp;
memcpy(&temp, &f, sizeof(temp));
temp = htonl(temp);
memcpy(valueBuffer, &temp, floatSize);
}
else if (floatSize == 8)
{
int64_t temp = htonll(*(uint64_t*)&value);
int64_t temp;
memcpy(&temp, &value, sizeof(temp));
temp = htonll(temp);
memcpy(valueBuffer, &temp, floatSize);
}
// once encoded, we can just treat this as opaque
Expand Down
3 changes: 1 addition & 2 deletions daemon/src/server/lwm2m_server_xml_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,14 +1482,13 @@ static int xmlif_HandlerWriteRequest(RequestInfoType * request, TreeNode content
IpcCoapRequestContext * requestContext;
Lwm2mClientType * client;
int numCoapRequests = 0;
Lwm2mTreeNode * root = NULL;

if (xmlif_HandleRequestHeader(request, content, &requestContext, &requestObjectsNode, &client) != 0)
{
goto error;
}

Lwm2mTreeNode * root = NULL;

TreeNode requestClientNode = TreeNode_GetParent(requestObjectsNode);

AwaWriteMode defaultWriteMode = AwaWriteMode_LAST;
Expand Down