1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
28 void handleSigInt(int signum);
31 * This method is an entry point of Resource Hosting Manager.
32 * This function should be run only on the device that it could be host device.
36 printf("OCResourceHosting is starting...\n");
38 if (OICStartCoordinate() != OC_STACK_OK)
40 printf("OICStartCoordinate fail\n");
44 printf("OCResourceHosting Started Successfully \n");
46 signal(SIGINT, handleSigInt);
52 if (OICStopCoordinate() != OC_STACK_OK)
54 printf("OICStopCoordinate error\n");
58 printf("OICStopCoordinate success\n");
61 printf("Exiting occlient main loop...\n");
67 * This is a signal handling function for SIGINT(CTRL+C).
68 * A Resource Coordinator handle the SIGINT signal for safe exit.
71 * signal number of caught signal.
73 void handleSigInt(int signum)