| 185 | #define TRACE rig_debug(RIG_DEBUG_ERR, "TRACE %s(%d)\n", __func__,__LINE__); |
| 186 | |
| 187 | static int network_init() |
| 188 | { |
| 189 | int retval = -RIG_EINTERNAL; |
| 190 | #ifdef __MINGW32__ |
| 191 | WSADATA wsadata; |
| 192 | |
| 193 | if (wsstarted == 0) |
| 194 | { |
| 195 | retval = WSAStartup(MAKEWORD(1, 1), &wsadata); |
| 196 | |
| 197 | if (retval == 0) |
| 198 | { |
| 199 | wsstarted = 1; |
| 200 | rig_debug(RIG_DEBUG_VERBOSE, "%s: WSAStartup OK\n", __func__); |
| 201 | } |
| 202 | else |
| 203 | { |
| 204 | rig_debug(RIG_DEBUG_ERR, "%s: error creating socket, WSAStartup ret=%d\n", |
| 205 | __func__, retval); |
| 206 | return (-RIG_EIO); |
| 207 | } |
| 208 | } |
| 209 | else // already started |
| 210 | { |
| 211 | retval = RIG_OK; |
| 212 | } |
| 213 | |
| 214 | #else |
| 215 | retval = RIG_OK; |
| 216 | |
| 217 | #endif |
| 218 | return retval; |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * \brief Open network port using STATE(rig) data |
no test coverage detected