1 /* ****************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
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 ******************************************************************/
23 * This file is an interface of routing manager and resource interospection layer.
25 #ifndef ROUTING_MANAGER_INTERFACE_H_
26 #define ROUTING_MANAGER_INTERFACE_H_
28 #include "routingmanager.h"
36 * Creates a Gateway resource and initializes the observer List.
37 * @return ::OC_STACK_OK or Appropriate error code.
39 OCStackResult RMInitGatewayResource();
42 * Send multicast discover request for the Gateway resource.
43 * @return ::OC_STACK_OK or Appropriate error code.
45 OCStackResult RMDiscoverGatewayResource();
48 * Send observe request for the gateway device hosting the Gateway resource.
49 * @param[in] devAddr Device address of the Gateway device hosting
50 * the gateway resource.
51 * @param[in] payload Payload to be sent with the request.
52 * @return ::OC_STACK_OK or Appropriate error code.
54 OCStackResult RMSendObserveRequest(const OCDevAddr *devAddr, OCRepPayload *payload);
57 * Send delete request to all the neighbor nodes.
58 * @param[in] devAddr Device address of the Gateway device hosting
59 * the gateway resource.
60 * @param[in] payload Payload to be sent with the request.
61 * @return ::OC_STACK_OK or Appropriate error code.
63 OCStackResult RMSendDeleteRequest(const OCDevAddr *devAddr, OCRepPayload *payload);
66 * Send a response for GET/OBSERVE request received for Gateway resource.
67 * @param[in] request Request Received.
68 * @param[in] resource Resource Handle.
69 * @param[in] payload Payload containing Gateway Entries.
70 * @return ::OC_STACK_OK or Appropriate error code.
72 OCStackResult RMSendResponse(const OCServerRequest *request, const OCResource *resource,
73 const OCRepPayload *payload);
76 * Send notification for list of observers except a particular observer.
77 * @param[in] obsId Observer who shouldn't be sent notification.
78 * @param[in] obsLen Length of Observer ID list.
79 * @param[in] payload Payload containing Gateway Entries.
80 * @return ::OC_STACK_OK or Appropriate error code.
82 OCStackResult RMSendNotificationForListofObservers(OCObservationId *obsId, uint8_t obsLen,
83 const OCRepPayload *payload);
86 * Adds an observer to the RI stack.
87 * @param[in] request Request handle.
88 * @param[out] obsID Observer ID generated for the requester.
89 * @return ::OC_STACK_OK or Appropriate error code.
91 OCStackResult RMAddObserverToStack(const OCServerRequest *request, OCObservationId *obsID);
97 #endif /* ROUTING_MANAGER_INTERFACE_H_ */