From 22d015c9c028cc73a61f1328fb94741102fc3116 Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Wed, 13 Dec 2017 19:21:19 +0900 Subject: [PATCH] Enable MOT test sample - Enabled MOT sampleserver_justworks's SVR DB - Make sampleserver_justworks self-owning - Make sampleserver_justworks use fixed UUID Signed-off-by: saerome.kim --- packaging/d2d-manager.spec | 2 +- test/oic_svr_db_server_justworks.dat | Bin 919 -> 1133 bytes test/oic_svr_db_server_justworks.json | 161 +++++++++++++++++++--------------- test/sampleserver_justworks.cpp | 17 +++- 4 files changed, 102 insertions(+), 78 deletions(-) diff --git a/packaging/d2d-manager.spec b/packaging/d2d-manager.spec index 455b07e..33baedb 100644 --- a/packaging/d2d-manager.spec +++ b/packaging/d2d-manager.spec @@ -109,7 +109,7 @@ cp test/oic_svr_db_client.dat oic_svr_db_subowner_client.dat %files devel %manifest %{name}-devel.manifest -%defattr(-,root,root,-) +%defattr(-,network_fw,network_fw,-) %{NETWORK_FW_DATADIR}/oic_amss_db.dat %{NETWORK_FW_DATADIR}/oic_svr_db_client_devowner.dat %{NETWORK_FW_DATADIR}/oic_svr_db_client_directpairing.dat diff --git a/test/oic_svr_db_server_justworks.dat b/test/oic_svr_db_server_justworks.dat index e02d4658de65d2d6ba18c6c84d19bb5657964067..d4e46c2c0e046d898f1127fce3fe3ed124349492 100644 GIT binary patch delta 250 zcmbQv{+46IdB(}I%qo*VGx`B(Lohp#QAIx`CBGs!;@y4_RouiN`JW*T#7fNpvXYCF zO9WH%%kxrGzGS7OmSrZVP8Mg@5-F;N{jh*_mR zCAlayC1Tr>R1jUl|s|e(}B9M6%Dh5!XJ6Vlc LdU7A5GUI;$wx(Nt delta 276 zcmaFMF`a$Gc}8WkL~~PfV{;Q-b91vaU2`L|BwZ5|GgDo2GgDJ@Q!`656XVIB82v+u zP-l=;lwY2gT2xw^nNp!bjE2d9j4BZ+Dftz-5m)zvsNzP3G!T`V!;oB@T*8method) { - D2D_LOGE ( "Received OC_REST_GET from client"); + D2D_LOGE( "Received OC_REST_GET from client"); ehResult = ProcessGetRequest (entityHandlerRequest, &payload); } else if (OC_REST_PUT == entityHandlerRequest->method) { - D2D_LOGE ( "Received OC_REST_PUT from client"); + D2D_LOGE( "Received OC_REST_PUT from client"); ehResult = ProcessPutRequest (entityHandlerRequest, &payload); } else if (OC_REST_POST == entityHandlerRequest->method) { - D2D_LOGE ( "Received OC_REST_POST from client"); + D2D_LOGE( "Received OC_REST_POST from client"); ehResult = ProcessPostRequest (entityHandlerRequest, &response, &payload); } else { - D2D_LOGD ( "Received unsupported method %d from client", + D2D_LOGD( "Received unsupported method %d from client", entityHandlerRequest->method); ehResult = OC_EH_ERROR; } @@ -420,6 +420,8 @@ FILE* server_fopen(const char *path, const char *mode) (void)path; + D2D_LOGE("fopen %s", data_dir); + return fopen(data_dir, mode); } @@ -454,12 +456,17 @@ static void OtmEventHandler(void *ctx, const char *addr, uint16_t port, printf("--------------------------------------\n"); } +#include + int main() { + const uint8_t seed[6] = {0x00, 0x12, 0x34, 0x11, 0x22, 0x33}; struct timespec timeout; D2D_LOGE( "OCServer is starting..."); + SetDeviceIdSeed(seed, 6); + //This function should be invoked before invoke OCInit OCSetOtmEventHandler(NULL, OtmEventHandler); @@ -474,6 +481,8 @@ int main() return 0; } + OCConfigSelfOwnership(); + /* * Declare and create the example resource: LED */ -- 2.7.4