@@ -145,9 +145,9 @@ class Socket {
145
145
* The callback may be called in an interrupt context and should not
146
146
* perform expensive operations such as recv/send calls.
147
147
*
148
- * @param callback Function to call on state change
148
+ * @param func Function to call on state change
149
149
*/
150
- void attach (FunctionPointer callback );
150
+ void attach (Callback< void ()> func );
151
151
152
152
/* * Register a callback on state change of the socket
153
153
*
@@ -158,12 +158,12 @@ class Socket {
158
158
* The callback may be called in an interrupt context and should not
159
159
* perform expensive operations such as recv/send calls.
160
160
*
161
- * @param tptr Pointer to object to call method on
162
- * @param mptr Method to call on state change
161
+ * @param obj Pointer to object to call method on
162
+ * @param method Method to call on state change
163
163
*/
164
164
template <typename T, typename M>
165
- void attach (T *tptr , M mptr ) {
166
- attach (FunctionPointer (tptr, mptr ));
165
+ void attach (T *obj , M method ) {
166
+ attach (Callback< void ()>(obj, method ));
167
167
}
168
168
169
169
protected:
@@ -176,7 +176,7 @@ class Socket {
176
176
NetworkStack *_iface;
177
177
void *_socket;
178
178
uint32_t _timeout;
179
- FunctionPointer _callback;
179
+ Callback< void ()> _callback;
180
180
rtos::Mutex _lock;
181
181
};
182
182
0 commit comments