taler-xotp_fw

xOTP generator firmware
Log | Files | Refs | Submodules | README

autoPayInterface.c (1796B)


      1 /**
      2  * @file autoPayInterface.c
      3  * @author Adrian STEINER (steia19@bfh.ch)
      4  * @brief
      5  * @version 0.1
      6  * @date 03-08-2025
      7  *
      8  * @copyright (C) 2025 Adrian STEINER
      9  * This program is free software: you can redistribute it and/or modify
     10  * it under the terms of the GNU General Public License as published by
     11  * the Free Software Foundation, either version 3 of the License, or
     12  * (at your option) any later version.
     13  *
     14  * This program is distributed in the hope that it will be useful,
     15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17  * GNU General Public License for more details.
     18  *
     19  * You should have received a copy of the GNU General Public License
     20  * along with this program.  If not, see <https: //www.gnu.org/licenses/>.
     21  *
     22  */
     23 #include "autoPayInterface.h"
     24 #include <stdlib.h>
     25 
     26 uint8_t
     27 autoPay_initInterface(autoPayInterface *interfaceHandler,
     28                       autoPayPwrCB powerOnCB,
     29                       autoPayPwrCB powerOffCB,
     30                       autoPayGetPasscodes getPasscodesCB,
     31                       autoPayArePasscodesReceived arePasscodesReceivedCB,
     32                       autoPaySendURL sendURLCB,
     33                       autoPayIsURLRead isURLReadCB)
     34 {
     35   if (NULL == interfaceHandler || NULL == powerOnCB || NULL == powerOffCB ||
     36       NULL == getPasscodesCB || NULL == arePasscodesReceivedCB ||
     37       NULL == sendURLCB || NULL == isURLReadCB) {
     38     return EXIT_FAILURE;
     39   }
     40   interfaceHandler->powerOn = powerOnCB;
     41   interfaceHandler->powerOff = powerOffCB;
     42   interfaceHandler->getPasscodes = getPasscodesCB;
     43   interfaceHandler->arePasscodesReceived = arePasscodesReceivedCB;
     44   interfaceHandler->sendURL = sendURLCB;
     45   interfaceHandler->isURLRead = isURLReadCB;
     46   return EXIT_SUCCESS;
     47 }