Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/kaaproject/kaa into KAA-…
Browse files Browse the repository at this point in the history
…1146
  • Loading branch information
vchizhevsky committed Aug 19, 2016
2 parents eaac74e + 0831a1f commit 7b4dd0c
Show file tree
Hide file tree
Showing 58 changed files with 711 additions and 180 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ xcuserdata
Tests/Pods
**/.toDelete
/test-gh-pages-current/
doc/Programming-guide/Server-REST-APIs/swagger.json
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
Kaa open-source IoT platform
<p align="center">
<a src='http://www.kaaproject.org/'>
<img src='img/kaa_logo_fullsize.png' height=300 width=400 />
</a>
</p>

Kaa open-source IoT platform [![Build Status](https://travis-ci.org/kaaproject/kaa.svg?branch=master)](https://travis-ci.org/kaaproject/kaa)
============================

Welcome to Kaa!
Kaa is a production-ready, multi-purpose middleware platform for building complete end-to-end IoT solutions, connected applications, and smart products. The Kaa platform provides an open, feature-rich toolkit for the IoT product development and thus dramatically reduces associated cost, risks, and time-to-market. For a quick start, Kaa offers a set of out-of-the-box enterprise-grade IoT features that can be easily plugged in and used to implement a large majority of the IoT use cases.

# Getting started

For the quick start with Kaa IoT platform check out [Getting started](http://www.kaaproject.org/getting-started/) guide.
Alternatively, you can [deploy Kaa into your own environment](http://kaaproject.github.io/kaa/docs/v0.10.0/Administration-guide/System-installation/Single-node-installation/).

# Getting help

If you face some troubles with Kaa platform check out [Troubleshooting guide](http://kaaproject.github.io/kaa/docs/v0.10.0/Administration-guide/Troubleshooting/) and [Frequently asked questions](http://docs.kaaproject.org/display/KAA/Frequently+asked+questions) first and if you can't find the solution we welcome you to post your questions at the Kaa project [Google group](http://www.kaaproject.org/forum/).

# Documentation

Kaa documentation is a part of Kaa source code and is located in the [`doc/`](doc) folder. You can find the web version [here](http://kaaproject.github.io/kaa/).

# How to contribute

To contribute to Kaa IoT platform, please visit [How to contribute](http://kaaproject.github.io/kaa/docs/v0.10.0/Customization-guide/How-to-contribute/) guide.

# Where to report issues

You can report an issue by creating a corresponding ticket in [Kaa task tracker](http://jira.kaaproject.org/browse/KAA/), check out [Jira guide](http://kaaproject.github.io/kaa/docs/v0.10.0/Customization-guide/How-to-contribute/Jira-guide/) before submitting one.

Kaa is an open-source middleware platform for building, managing, and integrating connected products with the Internet of Everything.
# License

For further information please visit
Kaa IoT platform is licensed under [Apache Software License 2.0](http://www.apache.org/licenses/LICENSE-2.0).

* [Kaa website](http://www.kaaproject.org/)
* [Project wiki](http://docs.kaaproject.org/display/KAA/)
* [Task tracker](http://jira.kaaproject.org/browse/KAA/)
* [Google group](https://groups.google.com/forum/#!forum/kaaproject)
See [`LICENSE`](LICENSE) and [`copyright.txt`](copyright.txt) for details.
6 changes: 1 addition & 5 deletions client/client-multi/client-c/README
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ are installed:
1. C compiler supporting the C99 standard
2. cmake 2.8.8 or later

To build the Kaa SDK for the x86-64 platform, ensure that OpenSSL libraries
(ssl and crypto) are installed.

************************************
INSTALL
************************************
Expand Down Expand Up @@ -123,8 +120,7 @@ for a platform other than x86-64, do the following:
KAA_INCLUDE_PATHS - full path(s) to folder(s) containing additional
header files
KAA_SOURCE_FILES - full path(s) to additional source files
KAA_THIRDPARTY_LIBRARIES - third-party libraries (the name of the library,
for example, ssl, crypto)
KAA_THIRDPARTY_LIBRARIES - third-party libraries

In the CMakeLists.txt file:

Expand Down
2 changes: 1 addition & 1 deletion client/client-multi/client-c/docs/testing.org
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The macros in ~test/kaa_test.h~ are not intended to be used; they were part of t
test/test_meta_extension.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
#+end_src

Note that we include ~test/kaa_test_external.c~; that's an implementation of the platform layer for testing. (It does almost nothing, however.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
cmake_minimum_required(VERSION 3.5.2)
project(kaa-application C)

find_package(OpenSSL REQUIRED)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -g -Wall -Wextra")

add_subdirectory(kaa)

add_executable(kaa-app src/kaa-application.c)
target_link_libraries(kaa-app kaac crypto)
target_link_libraries(kaa-app kaac)
32 changes: 16 additions & 16 deletions client/client-multi/client-c/listfiles/UnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

if(KAA_UNITTESTS_COMPILE)
find_package(cmocka REQUIRED)
find_package(OpenSSL REQUIRED)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-reachable=yes --trace-children=yes -v")

include(CTest)
include(CMakeParseArguments)
endif()

################################################################################
Expand Down Expand Up @@ -89,7 +89,7 @@ if(WITH_EXTENSION_LOGGING)
test/platform-impl/test_ext_log_storage_memory.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

Expand All @@ -98,50 +98,50 @@ if(WITH_EXTENSION_LOGGING)
test/platform-impl/test_ext_log_upload_strategies.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

kaa_add_unit_test(NAME test_platform_protocol
SOURCES
test/test_platform_protocol.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
endif()

kaa_add_unit_test(NAME test_meta_extension
SOURCES
test/test_meta_extension.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_platform_utils
SOURCES
test/test_platform_utils.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_context
SOURCES
test/test_kaa_context.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_status
SOURCES
test/test_kaa_status.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_common
SOURCES
test/test_kaa_common.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_list
SOURCES
Expand All @@ -155,7 +155,7 @@ kaa_add_unit_test(NAME test_kaatcp_parser
test/kaatcp/kaatcp_parser_test.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

Expand All @@ -164,7 +164,7 @@ kaa_add_unit_test(NAME test_kaatcp_request
test/kaatcp/kaatcp_request_test.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

Expand All @@ -173,7 +173,7 @@ kaa_add_unit_test(NAME test_kaa_tcp_channel_bootstrap
test/kaa_tcp_channel/test_kaa_tcp_channel_bootstrap.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

Expand All @@ -182,13 +182,13 @@ kaa_add_unit_test(NAME test_kaa_common_schema
test/test_kaa_common_schema.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)

kaa_add_unit_test(NAME test_kaa_reallocation
SOURCES
test/utilities/test_kaa_reallocation.c
DEPENDS
kaac ${OPENSSL_LIBRARIES}
kaac
INC_DIRS
test)

Expand All @@ -210,12 +210,12 @@ kaa_add_unit_test(NAME test_kaa_extension_private
# test/kaa_tcp_channel/test_kaa_tcp_channel_operation.c
# test/kaa_test_external.c
# DEPENDS
# kaac ${OPENSSL_LIBRARIES}
# kaac
# INC_DIRS
# test)

kaa_add_unit_test(NAME test_kaa_channel_manager
SOURCES
test/test_kaa_channel_manager.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ target_link_libraries(extension_bootstrap PUBLIC kaac)
# SOURCES
# ${CMAKE_CURRENT_LIST_DIR}/test/test_kaa_bootstrap_manager.c
# DEPENDS
# kaac ${OPENSSL_LIBRARIES})
# kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ kaa_add_unit_test(NAME test_kaa_configuration_manager
${KAA_SRC_FOLDER}/platform-impl/common/kaa_failover_strategy.c
test/kaa_test_external.c
DEPENDS
kaac extension_configuration ${OPENSSL_LIBRARIES})
kaac extension_configuration)
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ kaa_add_unit_test(NAME test_event
${CMAKE_CURRENT_LIST_DIR}/test/test_kaa_event.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ kaa_add_unit_test(NAME test_log
${KAA_SRC_FOLDER}/kaa_status.c
${KAA_SRC_FOLDER}/platform-impl/common/kaa_failover_strategy.c
DEPENDS
kaac extension_logging ${OPENSSL_LIBRARIES})
kaac extension_logging)
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ kaa_add_unit_test(NAME test_kaa_notification_manager
SOURCES
${CMAKE_CURRENT_LIST_DIR}/test/test_kaa_notification.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ kaa_add_unit_test(NAME test_profile
test/kaa_test_external.c
${KAA_SRC_FOLDER}/gen/kaa_profile_gen.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ kaa_add_unit_test(NAME test_user_extension
${CMAKE_CURRENT_LIST_DIR}/test/test_kaa_user.c
test/kaa_test_external.c
DEPENDS
kaac ${OPENSSL_LIBRARIES})
kaac)
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ typedef sndc_socklen_t kaa_socklen_t;

#define KAA_HTONS(hostshort) sndc_htons((hostshort))
#define KAA_HTONL(hostlong) sndc_htonl((hostlong))
#define KAA_HTONLL(hostlonglong) htonll((hostlonglong))
#define KAA_HTONLL(hostlonglong) kaa_htonll((hostlonglong))

#define KAA_NTOHS(netshort) sndc_ntohs((netshort))
#define KAA_NTOHL(netlong) sndc_ntohl((netlong))
#define KAA_NTOHLL(netlonglong) ntohll((netlonglong))
#define KAA_NTOHLL(netlonglong) kaa_ntohll((netlonglong))

#endif /* ECONAIS_EC19D_SOCK_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ typedef socklen_t kaa_socklen_t;

#define KAA_HTONS(hostshort) htons((hostshort))
#define KAA_HTONL(hostlong) htonl((hostlong))
#define KAA_HTONLL(hostlonglong) htonll((hostlonglong))
#define KAA_HTONLL(hostlonglong) kaa_htonll((hostlonglong))

#define KAA_NTOHS(netshort) ntohs((netshort))
#define KAA_NTOHL(netlong) ntohl((netlong))
#define KAA_NTOHLL(netlonglong) ntohll((netlonglong))
#define KAA_NTOHLL(netlonglong) kaa_ntohll((netlonglong))

#endif /* CC32XX_SOCK_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define TYP_SMLE 1
#define TYP_BIGE 2

uint64_t htonll(uint64_t hostlonglong) {
uint64_t kaa_htonll(uint64_t hostlonglong) {
static int typ = TYP_INIT;
unsigned char c;
union {
Expand All @@ -41,7 +41,7 @@ uint64_t htonll(uint64_t hostlonglong) {
return x.ull;
}

uint64_t ntohll(uint64_t netlonglong)
uint64_t kaa_ntohll(uint64_t netlonglong)
{
return htonll(netlonglong);
return kaa_htonll(netlonglong);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
extern "C" {
#endif

uint64_t htonll(uint64_t hostlonglong);
uint64_t kaa_htonll(uint64_t hostlonglong);

uint64_t ntohll(uint64_t netlonglong);
uint64_t kaa_ntohll(uint64_t netlonglong);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ typedef socklen_t kaa_socklen_t;

#define KAA_HTONS(a) htons((a))
#define KAA_HTONL(a) htonl((a))
#define KAA_HTONLL(a) htonll((a))
#define KAA_HTONLL(a) kaa_htonll((a))

#define KAA_NTOHS(a) ntohs((a))
#define KAA_NTOHL(a) ntohl((a))
#define KAA_NTOHLL(a) ntohll((a))
#define KAA_NTOHLL(a) kaa_ntohll((a))
#endif /* ESP8266_SOCK_H */
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ typedef socklen_t kaa_socklen_t;

#define KAA_HTONS(hostshort) htons((hostshort))
#define KAA_HTONL(hostlong) htonl((hostlong))
#define KAA_HTONLL(hostlonglong) htonll((hostlonglong))
#define KAA_HTONLL(hostlonglong) kaa_htonll((hostlonglong))

#define KAA_NTOHS(netshort) ntohs((netshort))
#define KAA_NTOHL(netlong) ntohl((netlong))
#define KAA_NTOHLL(netlonglong) ntohll((netlonglong))
#define KAA_NTOHLL(netlonglong) kaa_ntohll((netlonglong))

#endif /* POSIX_SOCK_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -730,16 +730,21 @@ kaa_error_t kaa_platform_protocol_alloc_serialize_client_sync(kaa_platform_proto

ext_tcp_socket_state_t ext_tcp_utils_tcp_socket_check(kaa_fd_t fd, const kaa_sockaddr_t *destination, kaa_socklen_t destination_size)
{
/* Only to avoid compiler's warning */
(void)destination_size;

if (fd == ACCESS_POINT_SOCKET_FD) {
if(memcmp(destination, &DESTINATION_SOCKADDR,destination_size) == 0) {
int result_memcmp = memcmp(destination->sa_data, DESTINATION_SOCKADDR.sa_data,
sizeof(DESTINATION_SOCKADDR.sa_data));
if ((result_memcmp == 0) && (destination->sa_family == DESTINATION_SOCKADDR.sa_family)) {
if (access_point_test_info.socket_connecting_error_scenario) {
return KAA_TCP_SOCK_ERROR;
} else {
access_point_test_info.socket_connected = true;
}
}
}

return KAA_TCP_SOCK_CONNECTED;
}

Expand Down Expand Up @@ -795,9 +800,13 @@ ext_tcp_utils_function_return_state_t ext_tcp_utils_getaddrbyhost(kaa_dns_resolv

kaa_error_t ext_tcp_utils_open_tcp_socket(kaa_fd_t *fd, const kaa_sockaddr_t *destination, kaa_socklen_t destination_size)
{
int result_memcmp;

KAA_RETURN_IF_NIL3(fd, destination, destination_size, KAA_ERR_BADPARAM);

if(memcmp(destination, &DESTINATION_SOCKADDR,destination_size) == 0) {
result_memcmp = memcmp(destination->sa_data, DESTINATION_SOCKADDR.sa_data,
sizeof(DESTINATION_SOCKADDR.sa_data));
if ((result_memcmp == 0) && (destination->sa_family == DESTINATION_SOCKADDR.sa_family)) {
access_point_test_info.new_socket_created = true;
*fd = ACCESS_POINT_SOCKET_FD;
return KAA_ERR_NONE;
Expand Down

0 comments on commit 7b4dd0c

Please sign in to comment.