1 /** 2 * CAN module object for Linux socketCAN. 3 * 4 * This file is a template for other microcontrollers. 5 * 6 * @file CO_notify_pipe.h 7 * @ingroup CO_driver 8 * @author Martin Wagner 9 * @copyright 2017 - 2020 Neuberger Gebaeudeautomation GmbH 10 * 11 * 12 * This file is part of CANopenNode, an opensource CANopen Stack. 13 * Project home page is <https://github.com/CANopenNode/CANopenNode>. 14 * For more information on CANopen see <http://www.can-cia.org/>. 15 * 16 * Licensed under the Apache License, Version 2.0 (the "License"); 17 * you may not use this file except in compliance with the License. 18 * You may obtain a copy of the License at 19 * 20 * http://www.apache.org/licenses/LICENSE-2.0 21 * 22 * Unless required by applicable law or agreed to in writing, software 23 * distributed under the License is distributed on an "AS IS" BASIS, 24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 * See the License for the specific language governing permissions and 26 * limitations under the License. 27 */ 28 29 #ifndef CO_NOTIFY_PIPE_H_ 30 #define CO_NOTIFY_PIPE_H_ 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 /** 37 * @defgroup CO_pipe Pipe 38 * @ingroup CO_driver 39 * @{ 40 * 41 * This is needed to wake up the can socket when blocking in select 42 */ 43 44 /** 45 * Object 46 */ 47 typedef struct CO_NotifyPipe CO_NotifyPipe_t; 48 49 /** 50 * Create Pipe 51 * 52 * @return != null if successfully created 53 */ 54 CO_NotifyPipe_t *CO_NotifyPipeCreate(void); 55 56 /** 57 * Delete Pipe 58 * 59 * @param p pointer to object 60 */ 61 void CO_NotifyPipeFree(CO_NotifyPipe_t *p); 62 63 /** 64 * Get file descriptor for select 65 * 66 * @param p pointer to object 67 */ 68 int CO_NotifyPipeGetFd(CO_NotifyPipe_t *p); 69 70 /** 71 * Send event 72 * 73 * @param p pointer to object 74 */ 75 void CO_NotifyPipeSend(CO_NotifyPipe_t *p); 76 77 /** @} */ 78 79 #ifdef __cplusplus 80 } 81 #endif /*__cplusplus*/ 82 83 #endif /* CO_NOTIFY_PIPE_H_ */ 84 85 /** 86 * @} @} 87 **/ 88