Changes between Version 8 and Version 9 of ObjectDeveloperGuide

Show
Ignore:
Timestamp:
05/11/09 17:46:22 (17 years ago)
Author:
ismael (IP: 192.168.4.1)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ObjectDeveloperGuide

    v8 v9  
    1717 * The object reads once the initialization parameters and configures its behaviour. 
    1818 * Given a set of parameter values, the object produces an output set of streams as a function of an input set of streams within the defined resource utilization constraints. 
    19  
    20 == [[BR]]Defining an Object == 
     19[[BR]] 
     20== Defining an Object == 
    2121Given the previous definition of an object, we define a directory structure for its implementation in order to homogenize objects from several sources and to access easily to useful information. Generating a new object should follow this layout: 
    2222 
     
    2828||myobj/Makefile||For compilation|| 
    2929 
    30 ==  == 
    31 ==  == 
    32 ==  == 
    3330== Implementing the Object == 
    3431Once your object has been properly defined, you can begin coding it. Here we assume the reader is familiar with basic ALOE concepts, nevertheless, this section describes how to implement an ALOE Object and provides some examples. 
    3532 
    36 ===  === 
    3733=== Process Structure === 
    3834All the tasks a radio application shall realize must follow the following simple function structure: 
     
    5248 
    5349Note how the object owns the CPU during the time it process the message. After that, the object returns to the STATUS point handing the CPU over to ALOE again. In anomalous or time rules violation, ALOE may release the ownership from the object before returning to the STATUS point. 
    54  
    55 '''Figure 3.1 – ALOE Object Flow Diagram''' 
    5650 
    5751=== Coding an Object === 
     
    237231        int filter_type; 
    238232 
    239         fdi = NewFlow(“input”, FLOW_READ_ONLY); 
     233        fdi = CreateItf(“input”, FLOW_READ_ONLY); 
    240234        if (fdi < 0) { 
    241235                WriteLog(“Error creating flow\n”); 
    242236                return 0; 
    243237        } 
    244         fdo = CreateFlow(“output”, FLOW_WRITE_ONLY); 
     238        fdo = CreateItf(“output”, FLOW_WRITE_ONLY); 
    245239        if (fdo < 0) { 
    246240                WriteLog(“Error creating flow\n”); 
    247241                return 0; 
    248242        } 
    249         fdc = CreateFlow(“control”, FLOW_READ_ONLY); 
     243        fdc = CreateItf(“control”, FLOW_READ_ONLY); 
    250244        if (fdo < 0) { 
    251245                WriteLog(“Error creating flow\n”); 
     
    267261                return 0; 
    268262        } 
     263 
     264        /* perform non-realtime computations */ 
    269265        calc_fir_coefs(fir_coef,filter_type); 
    270         n = InitStatsFile(); 
    271         if (n < 0) { 
    272                 WriteLog (“Error initiating stats\n”); 
    273                 return 0; 
    274         } 
     266 
    275267        stat_outsignal = InitStat(“out_signal”); 
    276268        if (stat_outsignal < 0) { 
     
    301293                } 
    302294                /* Read from control interface */ 
    303                 n = ReadFlow(fdc, &control, sizeof(struct control_itf)); 
     295                n = ReadItf(fdc, &control, sizeof(struct control_itf)); 
    304296                if (n < 0) { 
    305297                        WriteLog(“Error reading from control flow\n”); 
     
    311303        /* receive a block of data */ 
    312304        do { 
    313                 n = ReadFlow(fdi, &input.data[rcv_len], long_in_block - rcv_len); 
     305                n = ReadItf(fdi, &input.data[rcv_len], long_in_block - rcv_len); 
    314306                if (n < 0) { 
    315307                        WriteLog(“Error reading from flow\n”); 
     
    324316        if (rcv_len == long_block) { 
    325317                my_process_function(input, output, fir_coef, long_in_block); 
    326                 n = WriteFlow(fdo, data_out.data, long_out_block); 
     318                n = WriteItf(fdo, data_out.data, long_out_block); 
    327319                if (n < 0) { 
    328320                        LogWrite(“Error writing to flow\n”); 
     
    339331} 
    340332}}} 
    341 [[BR]] 
    342 [[BR]] 
    343 [[BR]] 
    344 == Coding Style == 
    345 [[BR]] 
    346333[[BR]] 
    347334[[BR]] 
    348335== Compiling and Linking == 
    349 [[BR]] 
    350 [[BR]] 
    351  
    352 [wiki:ALOEImplementations "[Back to ALOE Implementations]"] 
     336 
     337Compiling an ALOE objects does not need any other consideration rather than linking with the ALOE SW Library and HW Library. Obviously, we have to pick the HW library of our system. Under linux, and once we have installed ALOE (binary or source), the libraries should appear at /usr/local/lib with the names libsw_api.a and libhw_api.a. 
     338 
     339If your prefer to use autoconf/automake tools these files might be useful: 
     340   * sample configure.in 
     341   * sample Makefile.am 
     342 
     343[wiki:ALOE "[Back to ALOE]"]