Kojo / TrainStat

TrainStat.cpp

Committer:
takashikojo
Date:
2015-06-26
Revision:
0:a59f55690685
Child:
1:26a0a9220f01

File content as of revision 0:a59f55690685:

#include <mbed.h>
#include <string>
#include "TrainStat.h"
#include "tokyoMetro.h"

TrainStat::TrainStat() {
        source = TOKYO_METRO ;
        TMetro_initLine() ;
} ;
 
TrainStat::~TrainStat(){ } ;

bool TrainStat::setLine(string line)
{
    switch(source) {
    case YAHOO_TRAIN: 
        return false ;
    case TOKYO_METRO:
        TMetro_setLine(line) ; 
        break ;
    default:
        return false ;
    }
    return true ;
}
bool TrainStat::getStat()
{
    switch(source) {
    case YAHOO_TRAIN: 
        return false ;
    case TOKYO_METRO:
        TMetro_query("datapoints", "odpt:TrainInformation", recvBuff, sizeof(recvBuff)) ;
        return TMetro_getStat(recvBuff) ;
    default:
        return false ;
    }
}