Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement verarbeitung #36

Open
FiratSusan opened this issue May 18, 2017 · 1 comment
Open

Implement verarbeitung #36

FiratSusan opened this issue May 18, 2017 · 1 comment

Comments

@FiratSusan
Copy link
Contributor

FiratSusan commented May 18, 2017

Implement verarbeitung.c

This file shall implement function to process incoming data from the Datenerfasser and passes the proccesed data to the Datenversender (Look comment below for example sequence diagram)

Example code how it could look like:

while(1){
 if(!running && IG_QUEUE_isEmpty())
  break;
 checkForNewDataInQueue();
 if(newData!=null)
  applyRules();
 checkIntervalls();
}

checkIntervalls(){
 for(rules){
  if(nowToSend){
   encodeToJSON();
   appendToQueue();
  }
 }
}

Special Cases:
If you want to stop the entire system, first the Datenerfasser has to stop collecting data, after that the loop will still run until the last item in the queue is processed, then the loop will break.

Create an verarbeitung.h which defines the functions and structs like:

  1. Struct to apply rules, specialy for each Input Typ, with the fields:
  • Function type
  • Output-ID
  • Function pointer
  • deadline for publish
  • publish interval
  • void* to store internal information
  1. A struct which acts as a super struct for the Input rules, with the fields
  • Input-ID
  • Datatype
  • List for the rules (structs)

Example:

typedef void (*inputFunction)(void*);

typedef struct{
 IG_STRING functiontype,
 IG_INT outputId,
 InputFunction function,
 /*...*/
} inputRule;
@FiratSusan
Copy link
Contributor Author

verarbeitung

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant