diff --git a/net/NetworkSocketAPI/Socket.cpp b/net/NetworkSocketAPI/Socket.cpp index fd32a30cb8..b525a2d6ae 100644 --- a/net/NetworkSocketAPI/Socket.cpp +++ b/net/NetworkSocketAPI/Socket.cpp @@ -148,7 +148,7 @@ int Socket::getsockopt(int level, int optname, void *optval, unsigned *optlen) } -void Socket::attach(FunctionPointer callback) +void Socket::attach(Callback callback) { _lock.lock(); diff --git a/net/NetworkSocketAPI/Socket.h b/net/NetworkSocketAPI/Socket.h index bee2d11a74..cb9d01df12 100644 --- a/net/NetworkSocketAPI/Socket.h +++ b/net/NetworkSocketAPI/Socket.h @@ -145,9 +145,9 @@ public: * The callback may be called in an interrupt context and should not * perform expensive operations such as recv/send calls. * - * @param callback Function to call on state change + * @param func Function to call on state change */ - void attach(FunctionPointer callback); + void attach(Callback func); /** Register a callback on state change of the socket * @@ -158,12 +158,12 @@ public: * The callback may be called in an interrupt context and should not * perform expensive operations such as recv/send calls. * - * @param tptr Pointer to object to call method on - * @param mptr Method to call on state change + * @param obj Pointer to object to call method on + * @param method Method to call on state change */ template - void attach(T *tptr, M mptr) { - attach(FunctionPointer(tptr, mptr)); + void attach(T *obj, M method) { + attach(Callback(obj, method)); } protected: @@ -176,7 +176,7 @@ protected: NetworkStack *_iface; void *_socket; uint32_t _timeout; - FunctionPointer _callback; + Callback _callback; rtos::Mutex _lock; };