Modified for W5500 Ethernet initialize
Fork of GMMP_mbed by
Network/Network.h@3:6b4536e1962f, 2015-08-12 (annotated)
- Committer:
- hkjung
- Date:
- Wed Aug 12 02:13:34 2015 +0000
- Revision:
- 3:6b4536e1962f
- Parent:
- 0:7e575e5f88ec
Modified for W5500 Ethernet initialize
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lesmin | 0:7e575e5f88ec | 1 | /** TCP Socket 통신을 위한 모듈 |
lesmin | 0:7e575e5f88ec | 2 | * @file Network.h |
lesmin | 0:7e575e5f88ec | 3 | * @date 2015/07/20 |
lesmin | 0:7e575e5f88ec | 4 | * @version 0.0.1.0 |
lesmin | 0:7e575e5f88ec | 5 | **/ |
lesmin | 0:7e575e5f88ec | 6 | |
lesmin | 0:7e575e5f88ec | 7 | #ifndef NETWORK_H_ |
lesmin | 0:7e575e5f88ec | 8 | #define NETWORK_H_ |
lesmin | 0:7e575e5f88ec | 9 | |
lesmin | 0:7e575e5f88ec | 10 | #include "Define.h" |
lesmin | 0:7e575e5f88ec | 11 | #include "GMMP_Util.h" |
lesmin | 0:7e575e5f88ec | 12 | |
lesmin | 0:7e575e5f88ec | 13 | /** |
lesmin | 0:7e575e5f88ec | 14 | *@brief 서버와 연결된 TCP Socket을 닫는다. |
lesmin | 0:7e575e5f88ec | 15 | */ |
lesmin | 0:7e575e5f88ec | 16 | void CloseSocket(); |
lesmin | 0:7e575e5f88ec | 17 | |
lesmin | 0:7e575e5f88ec | 18 | /** |
lesmin | 0:7e575e5f88ec | 19 | * @brief TCP Socket을 연결한다. |
lesmin | 0:7e575e5f88ec | 20 | * @return 성공 : GMMMP_SUCCESS, 실패 : @ref ErrorCode.h 참조 |
lesmin | 0:7e575e5f88ec | 21 | */ |
lesmin | 0:7e575e5f88ec | 22 | int Connect(); |
lesmin | 0:7e575e5f88ec | 23 | |
lesmin | 0:7e575e5f88ec | 24 | /** |
lesmin | 0:7e575e5f88ec | 25 | * @brief TCP Socket에 Write한다. |
lesmin | 0:7e575e5f88ec | 26 | * @param pBuf Write 버퍼 포인트. |
lesmin | 0:7e575e5f88ec | 27 | * @param nLen Write 버퍼 크기. |
lesmin | 0:7e575e5f88ec | 28 | * @return 성공 : GMMMP_SUCCESS, 실패 : @ref ErrorCode.h 참조 |
lesmin | 0:7e575e5f88ec | 29 | */ |
lesmin | 0:7e575e5f88ec | 30 | int WriteTCP(char* pBuf, int nLen); |
lesmin | 0:7e575e5f88ec | 31 | |
lesmin | 0:7e575e5f88ec | 32 | /** |
lesmin | 0:7e575e5f88ec | 33 | * @brief TCP Socket을 Read한다. |
lesmin | 0:7e575e5f88ec | 34 | * @param _pBuf Read 버퍼 포인트. |
lesmin | 0:7e575e5f88ec | 35 | * @param _nMaxlen Read 버퍼 최대 크기 |
lesmin | 0:7e575e5f88ec | 36 | * @return 성공 : GMMMP_SUCCESS, 실패 : @ref ErrorCode.h 참조 |
lesmin | 0:7e575e5f88ec | 37 | */ |
lesmin | 0:7e575e5f88ec | 38 | int ReadTCP(char* _pBuf, const int _nMaxlen); |
lesmin | 0:7e575e5f88ec | 39 | |
lesmin | 0:7e575e5f88ec | 40 | /** |
lesmin | 0:7e575e5f88ec | 41 | * @brief TCP Socket을 Read한다. (Blocking/Non-blocking 지원) |
lesmin | 0:7e575e5f88ec | 42 | * @param _pBuf Read 버퍼 포인트. |
lesmin | 0:7e575e5f88ec | 43 | * @param _nMaxlen Read 버퍼 최대 크기 |
lesmin | 0:7e575e5f88ec | 44 | * @param blocking blocking: 1, non-blocking: 0 |
lesmin | 0:7e575e5f88ec | 45 | * @return 성공 : GMMMP_SUCCESS, 실패 : @ref ErrorCode.h 참조 |
lesmin | 0:7e575e5f88ec | 46 | */ |
lesmin | 0:7e575e5f88ec | 47 | int ReadTCP2(char* _pBuf, const int _nMaxlen, byte blocking); |
lesmin | 0:7e575e5f88ec | 48 | |
lesmin | 0:7e575e5f88ec | 49 | /** |
lesmin | 0:7e575e5f88ec | 50 | * @brief TCP Socket 세션 유지를 확인한다. 세션이 연결이 되어 있지 않다면 연결을 시도한다. |
lesmin | 0:7e575e5f88ec | 51 | * @return 성공 : GMMMP_SUCCESS, 실패 : @ref ErrorCode.h 참조 |
lesmin | 0:7e575e5f88ec | 52 | */ |
lesmin | 0:7e575e5f88ec | 53 | int CheckSocket(); |
lesmin | 0:7e575e5f88ec | 54 | #endif /* NETWORK_H_ */ |