Mark's profileMark's spacePhotosBlogLists Tools Help

Blog


    April 04

    nesC Module

    Module 问题
    ledi 发表于 2006-5-16 19:29:00

    接口PeriodicReaderC:
    module PeriodicReaderC {
    provides interface StdControl;
    uses interface Timer<TMilli>;
    uses interface Read<uint16_t>;
    }
    implementation {
    uint16_t lastVal = 0;
    command error_t StdControl.start() {
    return call Timer.startPeriodic(1024);
    }
    command error_t StdControl.stop() {
    return call Timer.stop();
    }
    event void Timer.fired() {
    call Read.read();
    }
    event void Read.readDone(error_t err, uint16_t val) {
    if (err == SUCCESS) {
    lastVal = val;
    }
    }
    }
    知识点:在provides中提供的命令与使用的event的必须在implementation中实现。
    问题:1 在此接口中command error_t StdControl.start()
            与return call Timer.startPeriodic(1024)的关系是如何确定的?
          2 error_t的数据类型定义的具体含义是什么??