OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [debug/] [udp_dbglink.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2017 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      UDP transport level implementation.
6
 */
7
 
8
#ifndef __DEBUGGER_UDP_DBGLINK_SERVICE_H__
9
#define __DEBUGGER_UDP_DBGLINK_SERVICE_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/ilink.h"
14
#include "coreservices/itap.h"
15
 
16
namespace debugger {
17
 
18
class UdpService : public IService,
19
                   public ILink {
20
public:
21
    UdpService(const char *name);
22
    ~UdpService();
23
 
24
    /** IService interface */
25
    virtual void postinitService();
26
 
27
    /** ILink interface */
28
    virtual void getConnectionSettings(AttributeType *settings);
29
    virtual void setConnectionSettings(const AttributeType *target);
30
    virtual int sendData(const uint8_t *msg, int len);
31
    virtual int readData(const uint8_t *buf, int maxlen);
32
 
33
protected:
34
    int createDatagramSocket();
35
    void closeDatagramSocket();
36
    bool setBlockingMode(bool mode);
37
 
38
private:
39
    AttributeType timeout_;
40
    AttributeType blockmode_;
41
    AttributeType hostIP_;
42
    AttributeType boardIP_;
43
 
44
    struct sockaddr_in sockaddr_ipv4_;
45
    char               sockaddr_ipv4_str_[16];    // 3 dots  + 4 digits each 3 symbols + '\0' = 4*3 + 3 + 1;
46
    unsigned short     sockaddr_ipv4_port_;
47
    struct sockaddr_in remote_sockaddr_ipv4_;
48
    socket_def hsock_;
49
    char rcvbuf[4096];
50
};
51
 
52
DECLARE_CLASS(UdpService)
53
 
54
}  // namespace debugger
55
 
56
#endif  // __DEBUGGER_UDP_DBGLINK_SERVICE_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.