Subversion Repositories svn.mios32

Rev

Rev 1511 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1511 Rev 1724
Line 1... Line 1...
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
2
// $Id: UploadHandler.cpp 1511 2012-09-23 18:09:46Z tk $
2
// $Id: UploadHandler.cpp 1724 2013-03-28 20:23:40Z tk $
3
/*
3
/*
4
 * Upload Handler
4
 * Upload Handler
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 32... Line 32...
32
    , timeUpload(0.0)
32
    , timeUpload(0.0)
33
{
33
{
34
    clearCoreInfo();
34
    clearCoreInfo();
35
35
36
    // restore settings
36
    // restore settings
37
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
37
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
38
    if( propertiesFile ) {
38
    if( propertiesFile ) {
39
        deviceId = propertiesFile->getIntValue(T("deviceId"), 0x00);
39
        deviceId = propertiesFile->getIntValue(T("deviceId"), 0x00);
40
    }
40
    }
41
}
41
}
42
42
Line 69... Line 69...
69
void UploadHandler::setDeviceId(uint8 id)
69
void UploadHandler::setDeviceId(uint8 id)
70
{
70
{
71
    deviceId = id;
71
    deviceId = id;
72
72
73
    // store settings
73
    // store settings
74
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
74
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
75
    if( propertiesFile ) {
75
    if( propertiesFile ) {
76
        propertiesFile->setValue(T("deviceId"), deviceId);
76
        propertiesFile->setValue(T("deviceId"), deviceId);
77
    }
77
    }
78
}
78
}
79
79
Line 247... Line 247...
247
    // exit if thread is not running
247
    // exit if thread is not running
248
    if( uploadHandlerThread == 0 )
248
    if( uploadHandlerThread == 0 )
249
        return;
249
        return;
250
250
251
    // start parsing
251
    // start parsing
252
    uint8 *data = message.getRawData();
252
    uint8 *data = (uint8 *)message.getRawData();
253
    uint32 size = message.getRawDataSize();
253
    uint32 size = message.getRawDataSize();
254
    uint8 currentDeviceId = uploadHandlerThread->deviceId; // ensure that the device ID tagged to the thread will be taken
254
    uint8 currentDeviceId = uploadHandlerThread->deviceId; // ensure that the device ID tagged to the thread will be taken
255
255
256
256
257
    if( data[0] >= 0x80 && data[0] < 0xf8 )
257
    if( data[0] >= 0x80 && data[0] < 0xf8 )