Blame view

DUREX Vendor Control/CommunicationProtocol.h 1.19 KB
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
//
//  CommunicationProtocol.h
//  DUREX Vendor Control
//
//  Created by Imanol Barba on 5/23/14.
//  Copyright (c) 2014 Emmoco. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "EMFramework.h"
Imanol-Mikel Barba Sabariego authored
12
#define SLEEP_MS                ((int)100)
Imanol-Mikel Barba Sabariego authored
13
14
15
#define MAX_STRING_LENGTH       ((int)200)
#define MAX_RETRIES             ((int)3)
#define MAX_PRODUCT_NAME_LENGTH ((int)64)
Imanol-Mikel Barba Sabariego authored
16
#define MAX_CHANNELS            ((int)16)
Imanol-Mikel Barba Sabariego authored
17
18
19
#define MONEY_IN_NUM_UNITS      ((int)6)
#define MONEY_OUT_NUM_UNITS     ((int)3)
#define CHANGE_NUM_UNITS        ((int)2)
Imanol-Mikel Barba Sabariego authored
20
#define MAX_PRODUCTS            ((int)16)
Imanol-Mikel Barba Sabariego authored
21
#define SALE_STRING_LENGTH      ((int)36)
Imanol-Mikel Barba Sabariego authored
22
#define REPORT_SERVER_URL       @"http://seneca.upc.es:8090/machine"
Imanol-Mikel Barba Sabariego authored
23
24
25

@interface CommunicationProtocol : NSObject
Imanol-Mikel Barba Sabariego authored
26
27
-(void) writeMessage: (NSString*) message;
-(void) readMessage;
Imanol-Mikel Barba Sabariego authored
28
-(Boolean) establishConnection;
Imanol-Mikel Barba Sabariego authored
29
30
31
-(Boolean) updateTime: (NSDateComponents*) date;
-(Boolean) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents;
-(Boolean) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name;
Imanol-Mikel Barba Sabariego authored
32
-(NSString*) readSensorData;
Imanol-Mikel Barba Sabariego authored
33
-(NSString*) readSalesLog: (NSDateComponents*) start : (NSDateComponents*) end;
Imanol-Mikel Barba Sabariego authored
34
35
36
+(id) sharedProtocol;

@end