#include "bsphp_client.h"
#include "bsphp_config.h"

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

int main(void) {
    bsphp_client_t client;
    char *resp = NULL;

    SetConsoleOutputCP(65001);
    SetConsoleCP(65001);

    bsphp_client_init(&client);
    bsphp_client_set_verbose(&client, BSPHP_VERBOSE_DEFAULT);

    printf("== BSPHP CARD C DEMO ==\n");

    if (!bsphp_bootstrap(&client, &resp)) {
        printf("bootstrap failed\n");
        return 1;
    }
    printf("bootstrap raw response: %s\n", resp);
    free(resp);
    resp = NULL;

    /*
     * Card mode login sample:
     * if (bsphp_login_ic(&client, "demo_icid", "demo_icpwd", "machine_code_xxx", &resp)) {
     *     printf("login.ic raw response: %s\n", resp);
     *     free(resp);
     * }
     */

    return 0;
}
