Permalink
Browse files

Anjay 1.4.1

Features:
- Added CMake option `WITH_STATIC_DEPS_LINKED` that forces direct linkage of
  the library dependencies into the final target library
- Migrated to a new time API implemented in avs_commons
- Removed dependency on wget completely and used built-in downloader instead

Bugfixes:
- Fixed symbol visibility checks

Improvements:
- Renamed a few files to improve compatibility with various IDEs that do not
  handle files with non-unique naming across the entire project
- Lowered severity of some log messages that were actually not that critical
- Published example output from anjay_codegen.py script in the documentation
  • Loading branch information...
sznaider committed Oct 16, 2017
1 parent 8f74839 commit 2bbc7bd0f4e937548d199591bf81bd3960bbbd91
Showing with 1,394 additions and 1,303 deletions.
  1. +53 −58 CMakeLists.txt
  2. +2 −2 README.md
  3. +1 −1 avs_commons/git
  4. +0 −2 config/config.h.in
  5. +0 −1 config/posix-config.h.in
  6. +2 −9 demo/CMakeLists.txt
  7. +8 −9 demo/demo.c
  8. +1 −1 demo/demo_args.h
  9. +5 −4 demo/demo_cmds.c
  10. +5 −1 demo/{utils.c → demo_utils.c}
  11. 0 demo/{utils.h → demo_utils.h}
  12. +1 −1 demo/iosched.c
  13. +2 −2 demo/objects.h
  14. +1 −1 demo/objects/apn_conn_profile.c
  15. +1 −1 demo/objects/cell_connectivity.c
  16. +1 −1 demo/objects/conn_monitoring.c
  17. +1 −1 demo/objects/conn_statistics.c
  18. +1 −1 demo/objects/device.c
  19. +65 −75 demo/objects/download_diagnostics.c
  20. +8 −16 demo/objects/ext_dev_info.c
  21. +1 −1 demo/objects/firmware_update.c
  22. +1 −1 demo/objects/geopoints.c
  23. +5 −1 demo/objects/ip_ping.c
  24. +5 −1 demo/objects/location.c
  25. +1 −1 demo/objects/test.c
  26. +0 −208 demo/wget_downloader.c
  27. +0 −110 demo/wget_downloader.h
  28. +2 −0 doc/sphinx/source/BasicTutorial/BT2.rst
  29. +412 −2 doc/sphinx/source/Tools.rst
  30. 0 include_modules/anjay_modules/{dm.h → dm_utils.h}
  31. +3 −3 include_modules/anjay_modules/{io.h → io_utils.h}
  32. +3 −10 include_modules/anjay_modules/{utils.h → raw_buffer.h}
  33. +0 −2 include_modules/anjay_modules/{time.h → time_defs.h}
  34. +11 −11 include_public/anjay/core.h
  35. +4 −4 modules/access_control/CMakeLists.txt
  36. +1 −1 modules/access_control/src/{handlers.c → access_control_handlers.c}
  37. +1 −1 modules/access_control/src/{persistence.c → access_control_persistence.c}
  38. +1 −1 modules/access_control/src/{access_control.c → mod_access_control.c}
  39. +5 −5 modules/access_control/src/{access_control.h → mod_access_control.h}
  40. +2 −2 modules/access_control/src/test/access_control.c
  41. +1 −1 modules/access_control/src/test/persistence.c
  42. +3 −3 modules/attr_storage/CMakeLists.txt
  43. +4 −4 modules/attr_storage/src/{persistence.c → attr_storage_persistence.c}
  44. +3 −3 modules/attr_storage/src/{attr_storage.c → mod_attr_storage.c}
  45. +1 −1 modules/attr_storage/src/{attr_storage.h → mod_attr_storage.h}
  46. +1 −1 modules/attr_storage/src/test/attr_storage_test.h
  47. +1 −1 modules/attr_storage/src/test/persistence.c
  48. +1 −1 modules/persistence/CMakeLists.txt
  49. +10 −9 modules/persistence/src/{persistence.c → mod_persistence.c}
  50. +4 −4 modules/security/CMakeLists.txt
  51. +7 −6 modules/security/src/{security.c → mod_security.c}
  52. +1 −1 modules/security/src/{security.h → mod_security.h}
  53. +3 −3 modules/security/src/{persistence.c → security_persistence.c}
  54. +2 −2 modules/security/src/{transaction.c → security_transaction.c}
  55. +1 −1 modules/security/src/{transaction.h → security_transaction.h}
  56. +8 −7 modules/security/src/{utils.c → security_utils.c}
  57. +2 −2 modules/security/src/{utils.h → security_utils.h}
  58. +4 −4 modules/server/CMakeLists.txt
  59. +3 −3 modules/server/src/{server.c → mod_server.c}
  60. +3 −3 modules/server/src/{server.h → mod_server.h}
  61. +3 −3 modules/server/src/{persistence.c → server_persistence.c}
  62. +2 −2 modules/server/src/{transaction.c → server_transaction.c}
  63. +1 −1 modules/server/src/{transaction.h → server_transaction.h}
  64. +1 −1 modules/server/src/{utils.c → server_utils.c}
  65. +2 −2 modules/server/src/{utils.h → server_utils.h}
  66. +3 −4 src/{access_control.c → access_control_utils.c}
  67. +5 −5 src/{access_control.h → access_control_utils.h}
  68. +17 −14 src/{anjay.c → anjay_core.c}
  69. +7 −7 src/{anjay.h → anjay_core.h}
  70. +1 −1 src/coap/block/request.c
  71. +1 −1 src/coap/block/response.c
  72. +13 −8 src/coap/block/transfer.c
  73. +1 −1 src/coap/{log.h → coap_log.h}
  74. +1 −1 src/coap/{stream.h → coap_stream.h}
  75. +1 −1 src/coap/id_source/auto.h
  76. +15 −13 src/coap/stream/{client.c → client_internal.c}
  77. +1 −1 src/coap/stream/{client.h → client_internal.h}
  78. +26 −32 src/coap/stream/common.c
  79. +5 −3 src/coap/stream/common.h
  80. +1 −1 src/coap/stream/in.c
  81. +1 −1 src/coap/stream/in.h
  82. +4 −10 src/coap/stream/out.c
  83. +1 −1 src/coap/stream/out.h
  84. +6 −7 src/coap/stream/{server.c → server_internal.c}
  85. +1 −1 src/coap/stream/{server.h → server_internal.h}
  86. +3 −3 src/coap/stream/{stream.c → stream_internal.c}
  87. +2 −2 src/coap/stream/{stream.h → stream_internal.h}
  88. +2 −2 src/coap/test/block_response.c
  89. +15 −5 src/coap/test/servers.c
  90. +3 −3 src/coap/test/stream.c
  91. +3 −4 src/dm/discover.c
  92. +3 −4 src/dm/{attributes.c → dm_attributes.c}
  93. +1 −1 src/dm/{attributes.h → dm_attributes.h}
  94. +1 −1 src/dm/{execute.c → dm_execute.c}
  95. +3 −3 src/dm/{execute.h → dm_execute.h}
  96. +10 −4 src/dm/{handlers.c → dm_handlers.c}
  97. +1 −2 src/dm/modules.c
  98. +7 −7 src/dm/query.c
  99. +3 −2 src/dm/query.h
  100. +8 −9 src/{dm.c → dm_core.c}
  101. +4 −4 src/{dm.h → dm_core.h}
  102. +1 −1 src/downloader.h
  103. +10 −15 src/downloader/coap.c
  104. +4 −3 src/downloader/downloader.c
  105. +1 −1 src/downloader/http.c
  106. +1 −1 src/downloader/private.h
  107. +17 −17 src/downloader/test/downloader.c
  108. +11 −11 src/interface/{bootstrap.c → bootstrap_core.c}
  109. +1 −1 src/interface/{bootstrap.h → bootstrap_core.h}
  110. +10 −15 src/interface/register.c
  111. +2 −2 src/interface/register.h
  112. +21 −19 src/interface/test/bootstrap.c
  113. +1 −1 src/io/base64_out.c
  114. +1 −1 src/io/dynamic.c
  115. +1 −1 src/io/json_out.c
  116. +2 −2 src/io/text.c
  117. +3 −4 src/io/tlv_in.c
  118. +7 −11 src/io/tlv_out.c
  119. +1 −1 src/io/vtable.h
  120. +12 −15 src/{io.c → io_core.c}
  121. +6 −6 src/{io.h → io_core.h}
  122. +3 −4 src/notify.c
  123. +30 −42 src/{observe.c → observe_core.c}
  124. +5 −5 src/{observe.h → observe_core.h}
  125. +5 −7 src/observe_io.c
  126. +1 −1 src/raw_buffer.c
  127. +37 −39 src/sched.c
  128. +7 −7 src/sched.h
  129. +1 −1 src/sched_internal.h
  130. +3 −3 src/servers.h
  131. +5 −6 src/servers/activate.c
  132. +5 −5 src/servers/activate.h
  133. +2 −3 src/servers/connection_info.c
  134. +2 −2 src/servers/connection_info.h
  135. +1 −2 src/servers/offline.c
  136. +24 −21 src/servers/{register.c → register_internal.c}
  137. +1 −1 src/servers/{register.h → register_internal.h}
  138. +7 −8 src/servers/reload.c
  139. +7 −9 src/servers/{servers.c → servers_internal.c}
  140. 0 src/servers/{servers.h → servers_internal.h}
  141. +9 −7 src/test/anjay.c
  142. +1 −1 src/test/dm.c
  143. +29 −27 src/test/observe.c
  144. +36 −40 src/test/sched.c
  145. +1 −1 src/test/utils.c
  146. +1 −2 src/{utils.c → utils_core.c}
  147. +1 −14 src/{utils.h → utils_core.h}
  148. +1 −1 test/include/anjay_test/coap/stream.h
  149. +5 −4 test/include/anjay_test/dm.h
  150. +3 −3 test/include/anjay_test/mock_clock.h
  151. +2 −2 test/include/anjay_test/mock_dm.h
  152. +1 −1 test/src/coap/stream.c
  153. +3 −5 test/src/dm.c
  154. +16 −16 test/src/mock_clock.c
  155. +1 −1 test/src/mock_dm.c
  156. +69 −0 test_headers.py
  157. +85 −0 test_visibility.py
  158. +0 −91 test_visibility.sh
  159. +1 −1 travis/centos7/Dockerfile
  160. +1 −1 travis/prepare.sh
  161. +1 −1 travis/ubuntu-16.04/Dockerfile
View
@@ -26,7 +26,7 @@ if(WITH_FUZZ_TESTS)
endif()
project(anjay C)
set(ANJAY_VERSION "1.4.0" CACHE STRING "Anjay library version")
set(ANJAY_VERSION "1.4.1" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0)
set(ANJAY_BUILD_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/output")
@@ -47,9 +47,6 @@ include(cmake/install_utils.cmake)
################# FEATURES #####################################################
include(CMakeDependentOption)
include(TestBigEndian)
test_big_endian(ANJAY_BIG_ENDIAN)
# compilation flags
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
@@ -64,21 +61,13 @@ if(WITH_EXTRA_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Winit-self -Wmissing-declarations -Wc++-compat -Wsign-conversion -Wconversion -Wcast-qual -Wno-variadic-macros -Wno-long-long")
endif()
option(WITH_POSIX "Enable use of system-installed POSIX APIs" ON)
if(WITH_POSIX)
# macOS is weird and _POSIX_C_SOURCE causes a lot of things to disappear
if(NOT APPLE)
add_definitions(-D_POSIX_C_SOURCE=200809L)
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L)
endif()
else()
set(POSIX_COMPAT_HEADER "" CACHE STRING "POSIX compatibility header path")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/PosixFeatures.cmake)
cmake_dependent_option(WITH_DEMO "Compile DEMO applications" ON WITH_POSIX OFF)
option(WITH_DEMO "Compile DEMO applications" ON)
option(WITH_LIBRARY_SHARED "Compile Anjay as shared library" ON)
cmake_dependent_option(WITH_STATIC_DEPS_LINKED
"Directly link shared library with its static dependencies such as avs_commons (e.g. for interpreted language bindings)"
OFF WITH_LIBRARY_SHARED OFF)
option(WITH_ACCESS_CONTROL "Enable core support for Access Control mechanism" ON)
option(WITH_BLOCK_RECEIVE "Enable support for receiving CoAP BLOCK transfers" ON)
@@ -155,12 +144,12 @@ endmacro()
set(CORE_SOURCES
src/coap/id_source/auto.c
src/coap/id_source/static.c
src/coap/stream/client.c
src/coap/stream/client_internal.c
src/coap/stream/common.c
src/coap/stream/in.c
src/coap/stream/out.c
src/coap/stream/server.c
src/coap/stream/stream.c
src/coap/stream/server_internal.c
src/coap/stream/stream_internal.c
src/interface/register.c
src/io/base64_out.c
src/io/dynamic.c
@@ -169,26 +158,26 @@ set(CORE_SOURCES
src/io/text.c
src/io/tlv_in.c
src/io/tlv_out.c
src/dm.c
src/dm/attributes.c
src/dm/execute.c
src/dm/handlers.c
src/dm_core.c
src/dm/dm_attributes.c
src/dm/dm_execute.c
src/dm/dm_handlers.c
src/dm/modules.c
src/dm/query.c
src/anjay.c
src/io.c
src/anjay_core.c
src/io_core.c
src/notify.c
src/servers/activate.c
src/servers/connection_info.c
src/servers/offline.c
src/servers/reload.c
src/servers/register.c
src/servers/servers.c
src/servers/register_internal.c
src/servers/servers_internal.c
src/raw_buffer.c
src/sched.c
src/utils.c)
src/utils_core.c)
if(WITH_ACCESS_CONTROL)
set(CORE_SOURCES ${CORE_SOURCES} src/access_control.c)
set(CORE_SOURCES ${CORE_SOURCES} src/access_control_utils.c)
endif()
if(WITH_DOWNLOADER)
set(CORE_SOURCES ${CORE_SOURCES}
@@ -209,66 +198,66 @@ if(WITH_BLOCK_SEND)
src/coap/block/transfer.c)
endif()
if(WITH_BOOTSTRAP)
set(CORE_SOURCES ${CORE_SOURCES} src/interface/bootstrap.c)
set(CORE_SOURCES ${CORE_SOURCES} src/interface/bootstrap_core.c)
endif()
if(WITH_DISCOVER)
set(CORE_SOURCES ${CORE_SOURCES} src/dm/discover.c)
endif()
if(WITH_OBSERVE)
set(CORE_SOURCES ${CORE_SOURCES}
src/observe.c
src/observe_core.c
src/observe_io.c)
endif()
if(WITH_JSON)
set(CORE_SOURCES ${CORE_SOURCES}
src/io/json_out.c)
endif()
set(CORE_PRIVATE_HEADERS
src/access_control.h
src/access_control_utils.h
src/coap/block/request.h
src/coap/block/response.h
src/coap/block/transfer.h
src/coap/block/transfer_impl.h
src/coap/id_source/id_source.h
src/coap/id_source/auto.h
src/coap/id_source/static.h
src/coap/stream.h
src/coap/stream/client.h
src/coap/coap_stream.h
src/coap/stream/client_internal.h
src/coap/stream/common.h
src/coap/stream/in.h
src/coap/stream/out.h
src/coap/stream/server.h
src/coap/stream/stream.h
src/dm.h
src/dm/attributes.h
src/coap/stream/server_internal.h
src/coap/stream/stream_internal.h
src/dm_core.h
src/dm/dm_attributes.h
src/dm/discover.h
src/dm/execute.h
src/dm/dm_execute.h
src/dm/query.h
src/anjay.h
src/interface/bootstrap.h
src/anjay_core.h
src/interface/bootstrap_core.h
src/interface/register.h
src/io.h
src/io_core.h
src/io/tlv.h
src/io/vtable.h
src/observe.h
src/observe_core.h
src/sched.h
src/sched_internal.h
src/servers.h
src/servers/activate.h
src/servers/connection_info.h
src/servers/register.h
src/servers/servers.h
src/utils.h)
src/servers/register_internal.h
src/servers/servers_internal.h
src/utils_core.h)
set(CORE_MODULES_HEADERS
include_modules/anjay_modules/dm.h
include_modules/anjay_modules/dm_utils.h
include_modules/anjay_modules/dm/attributes.h
include_modules/anjay_modules/dm/execute.h
include_modules/anjay_modules/dm/modules.h
include_modules/anjay_modules/io.h
include_modules/anjay_modules/io_utils.h
include_modules/anjay_modules/notify.h
include_modules/anjay_modules/observe.h
include_modules/anjay_modules/time.h
include_modules/anjay_modules/utils.h)
include_modules/anjay_modules/time_defs.h
include_modules/anjay_modules/raw_buffer.h)
set(CORE_PUBLIC_HEADERS
include_public/anjay/anjay.h
include_public/anjay/core.h
@@ -422,18 +411,20 @@ include_directories(${PUBLIC_INCLUDE_DIRS}
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/config/config.h")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config/posix-config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/config/posix-config.h")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/config")
if(WITH_LIBRARY_SHARED)
add_library(${PROJECT_NAME} SHARED ${ABSOLUTE_SOURCES})
target_link_libraries(${PROJECT_NAME} ${DEPS_LIBRARIES})
target_link_libraries(${PROJECT_NAME} LINK_INTERFACE_LIBRARIES ${DEPS_LIBRARIES_WEAK})
anjay_emit_deps(${PROJECT_NAME} ${DEPS_LIBRARIES_WEAK})
if(WITH_STATIC_DEPS_LINKED)
target_link_libraries(${PROJECT_NAME} ${DEPS_LIBRARIES} ${DEPS_LIBRARIES_WEAK})
else()
target_link_libraries(${PROJECT_NAME} ${DEPS_LIBRARIES})
target_link_libraries(${PROJECT_NAME} LINK_INTERFACE_LIBRARIES ${DEPS_LIBRARIES_WEAK})
anjay_emit_deps(${PROJECT_NAME} ${DEPS_LIBRARIES_WEAK})
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${ANJAY_BINARY_VERSION})
if(HAVE_VISIBILITY)
if(HAVE_VISIBILITY AND NOT WITH_STATIC_DEPS_LINKED)
get_property(LINK_FLAGS TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS)
set_property(TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs,ALL")
endif()
@@ -509,12 +500,16 @@ endif()
################# SOURCE VALIDATION ############################################
foreach(F ${ABSOLUTE_SOURCES})
add_test(NAME test_${F}_visibility COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_visibility.sh ${F})
add_test(NAME test_${F}_visibility COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_visibility.py ${F})
add_test(NAME test_${F}_headers COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_headers.py ${F})
endforeach()
add_custom_target(visibility_check COMMAND ${CMAKE_CTEST_COMMAND} -R "'^test_.*_visibility$$'")
add_dependencies(anjay_unit_check visibility_check)
add_custom_target(headers_check COMMAND ${CMAKE_CTEST_COMMAND} -R "'^test_.*_headers$$'")
add_dependencies(anjay_unit_check headers_check)
set(ABSOLUTE_HEADERS)
foreach(F ${ABSOLUTE_SOURCES})
if(F MATCHES [.]h$)
@@ -536,7 +531,7 @@ add_dependencies(anjay_unit_check
add_custom_target(symbols_check COMMAND ${CMAKE_CTEST_COMMAND} -R "'^test_.*_symbols$$'" --output-on-failure)
if(WITH_LIBRARY_SHARED)
if(WITH_LIBRARY_SHARED AND NOT WITH_STATIC_DEPS_LINKED)
add_test(NAME test_so_symbols COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_symbols.sh $<TARGET_FILE:${PROJECT_NAME}> anjay_ ANJAY_)
add_dependencies(symbols_check ${PROJECT_NAME})
endif()
View
@@ -107,15 +107,15 @@ More details about OMA LwM2M: [Brief introduction to LwM2M](https://AVSystem.git
To install everything on Ubuntu 16.04 LTS:
``` sh
sudo apt-get install git build-essential cmake libmbedtls-dev wget
sudo apt-get install git build-essential cmake libmbedtls-dev
# Optionally for tests:
sudo apt-get install libpython3-dev libssl-dev python3 python3-cryptography python3-sphinx clang
```
Or on macOS Sierra with [Homebrew](https://brew.sh/):
``` sh
brew install cmake mbedtls wget
brew install cmake mbedtls
# Optionally for tests:
brew install python3 openssl llvm
pip3 install cryptography sphinx sphinx_rtd_theme
Submodule git updated 133 files
View
@@ -59,5 +59,3 @@
#define ANJAY_MAX_URI_SEGMENT_SIZE @MAX_URI_SEGMENT_SIZE@
#define ANJAY_MAX_URI_QUERY_SEGMENT_SIZE @MAX_URI_QUERY_SEGMENT_SIZE@
#cmakedefine ANJAY_BIG_ENDIAN
View

This file was deleted.

Oops, something went wrong.
View
@@ -19,9 +19,8 @@ set(SOURCES
demo.c
demo_args.c
demo_cmds.c
demo_utils.c
iosched.c
utils.c
wget_downloader.c
objects/apn_conn_profile.c
objects/cell_connectivity.c
objects/conn_monitoring.c
@@ -38,20 +37,14 @@ set(SOURCES
set(HEADERS
iosched.h
objects.h
utils.h
wget_downloader.h)
demo_utils.h)
set(ALL_SOURCES ${SOURCES} ${HEADERS})
if(NOT ANJAY_INCLUDE_DIRS AND NOT ANJAY_LIBRARIES)
find_package(anjay REQUIRED HINTS "${CMAKE_CURRENT_SOURCE_DIR}/..")
endif()
find_program(WGET_EXECUTABLE wget)
if(NOT WGET_EXECUTABLE)
message(FATAL_ERROR "wget executable is necessary for the demo application")
endif()
if(TARGET ${ANJAY_LIBRARIES_STATIC})
set(DEMO_ANJAY_TARGET "${ANJAY_LIBRARIES_STATIC}")
else()
View
@@ -34,7 +34,7 @@
#include "demo_cmds.h"
#include "iosched.h"
#include "objects.h"
#include "utils.h"
#include "demo_utils.h"
char **saved_argv;
@@ -309,8 +309,7 @@ static int demo_init(anjay_demo_t *demo,
|| install_object(demo, cm_object_create(),
cm_notify_time_dependent, cm_object_release)
|| install_object(demo, cs_object_create(), NULL, cs_object_release)
|| install_object(demo,
download_diagnostics_object_create(demo->iosched),
|| install_object(demo, download_diagnostics_object_create(),
NULL, download_diagnostics_object_release)
|| install_object(demo,
device_object_create(demo->iosched,
@@ -443,25 +442,25 @@ static void refresh_socket_entries(anjay_demo_t *demo,
static void serve(anjay_demo_t *demo) {
AVS_LIST(socket_entry_t) socket_entries = NULL;
struct timespec last_time;
clock_gettime(CLOCK_REALTIME, &last_time);
avs_time_real_t last_time = avs_time_real_now();
while (demo->running) {
refresh_socket_entries(demo, &socket_entries);
demo_log(TRACE, "number of sockets to poll: %u",
(unsigned) AVS_LIST_SIZE(socket_entries));
struct timespec current_time;
clock_gettime(CLOCK_REALTIME, &current_time);
avs_time_real_t current_time = avs_time_real_now();
if (current_time.tv_sec != last_time.tv_sec) {
if (current_time.since_real_epoch.seconds
!= last_time.since_real_epoch.seconds) {
notify_time_dependent(demo);
}
last_time = current_time;
int waitms = anjay_sched_calculate_wait_time_ms(
demo->anjay,
(int) ((1000500000 - current_time.tv_nsec) / 1000000));
(int) ((1000500000 - current_time.since_real_epoch.nanoseconds)
/ 1000000));
demo_log(TRACE, "wait time: %ld.%09ld s",
time_to_next_job.tv_sec, time_to_next_job.tv_nsec);
View
@@ -21,7 +21,7 @@
#include <anjay/anjay.h>
#include "objects.h"
#include "utils.h"
#include "demo_utils.h"
typedef struct access_entry {
anjay_ssid_t ssid;
View
@@ -16,7 +16,7 @@
#include "demo.h"
#include "demo_cmds.h"
#include "utils.h"
#include "demo_utils.h"
#include <ctype.h>
#include <string.h>
@@ -181,9 +181,10 @@ static void cmd_get_port(anjay_demo_t *demo, const char *args_string) {
index, num_sockets);
}
char port[16] = "0";
avs_net_abstract_socket_t *socket = *AVS_LIST_NTH(sockets, (size_t) index);
if (socket) {
avs_net_socket_get_local_port(socket, port, sizeof(port));
AVS_LIST(avs_net_abstract_socket_t *const) socket =
AVS_LIST_NTH(sockets, (size_t) index);
if (socket && *socket) {
avs_net_socket_get_local_port(*socket, port, sizeof(port));
}
printf("PORT==%s\n", port);
}
Oops, something went wrong.

0 comments on commit 2bbc7bd

Please sign in to comment.