1 /*--------------------------------------------------------------------------
2   Project:  HorizonSDK
3   File:     rdt_Transceiver.h
4 
5   Copyright 2009 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2010-07-21#$
14   $Rev: 21558 $
15   $Author: hiratsu_daisuke $
16  *-------------------------------------------------------------------------*/
17 
18 #include "stdafx.h"
19 
20 #ifndef NN_RDT_TRANSCEIVER_H_
21 #define NN_RDT_TRANSCEIVER_H_
22 
23 
24 #include "rdt_Segment.h"
25 
26 namespace nn { namespace rdt { namespace CTR {
27 
28 /* Please see man pages for details
29 
30 */
31 class Transceiver{
32 public:
33 /* Please see man pages for details
34 
35 */
36     Transceiver(void);
37 
38 /* Please see man pages for details
39 
40 */
41    ~Transceiver(void);
42 
43 /* Please see man pages for details
44 
45 */
46 #ifdef _WIN32
47     nn::Result Initialize(SOCKET sock);
48 #elif defined(NN_PLATFORM_CTR)
49     nn::Result Initialize(u16 nodeId, u8 port);  // Sender node ID and port number
50 #else
51     #error no platform selected
52 #endif
53 
54 /* Please see man pages for details
55 
56 */
57     void Finalize(void);
58 
59 /* Please see man pages for details
60 
61 
62 
63 
64 
65 
66 */
67     nn::Result Put(const Segment &seg);
68 
69 /* Please see man pages for details
70 
71 */
72     nn::Result Pull(Segment *pSeg);
73 
74 /* Please see man pages for details
75 
76 */
77     static void Test(void);
78 
79 private:
80 /* Please see man pages for details
81 
82 */
83     Transceiver           (const Transceiver&);
84 
85 /* Please see man pages for details
86 
87 */
88     Transceiver& operator=(const Transceiver&);
89 
90     bool                        m_initialized;
91     u8                          m_padding1[3];
92 #ifdef _WIN32
93     SOCKET m_sock;
94 #elif defined(NN_PLATFORM_CTR)
95     nn::uds::EndpointDescriptor m_sendEp;
96     nn::uds::EndpointDescriptor m_recvEp;
97     u16                         m_remoteNodeId;  // Communication partner node ID
98     u8                          m_port;
99     u8                          m_padding2[1];
100 #else
101     #error no platform selected
102 #endif
103 };
104 
105 }}} // namespace nn::rdt::CTR
106 
107 #endif  // end of NN_RDT_TRANSCEIVER_H_
108