1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     rdt_Transceiver.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  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   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 #include "stdafx.h"
17 
18 #ifndef NN_LIBRARIES_RDT_CTR_RDT_TRANSCEIVER_H_
19 #define NN_LIBRARIES_RDT_CTR_RDT_TRANSCEIVER_H_
20 
21 
22 #include "rdt_Segment.h"
23 
24 namespace nn { namespace rdt { namespace CTR {
25 
26 /* Please see man pages for details
27 
28 */
29 class Transceiver{
30 public:
31 /* Please see man pages for details
32 
33 */
34     Transceiver(void);
35 
36 /* Please see man pages for details
37 
38 */
39    ~Transceiver(void);
40 
41 /* Please see man pages for details
42 
43 */
44 #ifdef _WIN32
45     nn::Result Initialize(SOCKET sock);
46 #elif defined(NN_PLATFORM_CTR)
47     nn::Result Initialize(u16 nodeId, u8 port);  // Send destination node ID and port number
48 #else
49     #error no platform selected
50 #endif
51 
52 /* Please see man pages for details
53 
54 */
55     void Finalize(void);
56 
57 /* Please see man pages for details
58 
59 
60 
61 
62 
63 
64 */
65     nn::Result Put(const Segment &seg);
66 
67 /* Please see man pages for details
68 
69 */
70     nn::Result Pull(Segment *pSeg);
71 
72 /* Please see man pages for details
73 
74 */
75     static void Test(void);
76 
77 private:
78 /* Please see man pages for details
79 
80 */
81     Transceiver           (const Transceiver&);
82 
83 /* Please see man pages for details
84 
85 */
86     Transceiver& operator=(const Transceiver&);
87 
88     bool                        m_initialized;
89     u8                          m_padding1[3];
90 #ifdef _WIN32
91     SOCKET m_sock;
92 #elif defined(NN_PLATFORM_CTR)
93     nn::uds::EndpointDescriptor m_sendEp;
94     nn::uds::EndpointDescriptor m_recvEp;
95     u16                         m_remoteNodeId;  // Node ID of communication partner
96     u8                          m_port;
97     u8                          m_padding2[1];
98 #else
99     #error no platform selected
100 #endif
101 };
102 
103 }}} // namespace nn::rdt::CTR
104 
105 #endif  // end of NN_LIBRARIES_RDT_CTR_RDT_TRANSCEIVER_H_
106