Subversion Repositories seema-scanner

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 jakw 1
/*****************************************************************************
2
 **             TEXAS INSTRUMENTS PROPRIETARY INFORMATION
3
 **
4
 **  (c) Copyright, Texas Instruments Incorporated, 2012-2013.
5
 **      All Rights Reserved.
6
 **
7
 **  Property of Texas Instruments Incorporated. Restricted Rights -
8
 **  Use, duplication, or disclosure is subject to restrictions set
9
 **  forth in TI's program license agreement and associated documentation.
10
 ******************************************************************************/
11
/**
12
 *
13
 * @file    lcr_packetizer.h
14
 *
15
 * @brief	This file is responsible for packetizing the data the functions
16
 *          defined in this file are called by lcr_cmd file
17
 **/
18
/*****************************************************************************/
19
 
20
#ifndef LCR_PACKETIZER_H_
21
#define LCR_PACKETIZER_H_
22
 
23
#include "common.h"
24
#include "error.h"
25
 
26
#ifdef __cplusplus
27
extern "C" {
28
#endif
29
 
30
#define HEADER_SIZE			6
31
#define MAX_PACKET_SIZE		0xFFFF
32
#define CHECKSUM_SIZE		1
33
 
34
#define LCR_CMD_IP			"192.168.1.100"
35
#define LCR_CMD_PORT		0x5555
36
 
37
    enum LCR_PacketType {
38
        PKT_TYPE_BUSY,
39
        PKT_TYPE_ERROR,
40
        PKT_TYPE_WRITE,
41
        PKT_TYPE_WRITE_RESP,
42
        PKT_TYPE_READ,
43
        PKT_TYPE_READ_RESP
44
    };
45
 
46
    typedef enum
47
    {
48
        LCR_CMD_PKT_TYPE_READ,
49
        LCR_CMD_PKT_TYPE_WRITE,
50
    } LCR_CommandType_t;
51
 
52
    ErrorCode_t LCR_CMD_PKT_ConnectToLCR(void);
53
    ErrorCode_t LCR_CMD_PKT_DisconnectLCR(void);
54
 
55
    int LCR_CMD_PKT_CommandInit(LCR_CommandType_t cmdType, uint16 cmd);
56
    int LCR_CMD_PKT_PutData(uint8 *data, unsigned long int size);
57
    int LCR_CMD_PKT_PutInt(uint32 value, unsigned int size);
58
    int LCR_CMD_PKT_GetData(uint8 *data, unsigned long int size);
59
    uint32 LCR_CMD_PKT_GetInt(unsigned int size);
60
    int LCR_CMD_PKT_PutFile(char const *fileName);
61
    int LCR_CMD_PKT_GetFile(char const *fileName,uint32 size);
62
    int LCR_CMD_PKT_SendCommand(void);
63
 
64
    int LCR_CMD_PKT_ReceivePacket(BOOL firstPkt);
65
    int LCR_CMD_PKT_SendPacket(BOOL more);
66
 
67
#ifdef __cplusplus
68
}
69
#endif
70
 
71
#endif /* LCR_PACKETIZER_H_ */
72