<commit_before>/*
 * Copyright 2015 <NAME>
 * Licensed under MIT license, see included file LICENSE or
 * http://opensource.org/licenses/MIT
 */

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

#define NXP_HW_SELF_TEST
#include "linux_nfc_factory_api.h"
#include "linux_nfc_api.h"

#define MAIN_SLEEP 10000

static void tagArrived(nfc_tag_info_t *p_taginfo)
{
    printf("\nTag arrived!\n");
}

static void tagDeparted(void)
{
    printf("\nTag departed!\n");
}

int main(int argc, char ** argv)
{
    // initialize nfcManager
    int result = nfcManager_doInitialize();
    if(result != 0) {
        printf("nfcManager_doInitialize failed with error code %d", result);
        exit(result);
    }

    // try to get versions
    #ifdef NXP_HW_SELF_TEST
    printf("nfcFactory_GetMwVersion:\t0x%x\n", nfcFactory_GetMwVersion());
    #endif
    printf("nfcManager_getFwVersion:\t0x%x\n\n", nfcManager_getFwVersion());

    // set up tag-callback
    nfcTagCallback_t cb_tag;
	cb_tag.onTagArrival = tagArrived;
	cb_tag.onTagDeparture = tagDeparted;
	nfcManager_registerTagCallback(&cb_tag);

	nfcManager_enableDiscovery(DEFAULT_NFA_TECH_MASK, 0x00, 0x00, 0);

    while(1) {
        usleep(MAIN_SLEEP);
    }<commit_msg>0x00 -> 0<commit_after>/*
 * Copyright 2015 <NAME>
 * Licensed under MIT license, see included file LICENSE or
 * http://opensource.org/licenses/MIT
 */

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

#define NXP_HW_SELF_TEST
#include "linux_nfc_factory_api.h"
#include "linux_nfc_api.h"

#define MAIN_SLEEP 10000

static void tagArrived(nfc_tag_info_t *p_taginfo)
{
    printf("\nTag arrived!\n");
}

static void tagDeparted(void)
{
    printf("\nTag departed!\n");
}

int main(int argc, char ** argv)
{
    // initialize nfcManager
    int result = nfcManager_doInitialize();
    if(result != 0) {
        printf("nfcManager_doInitialize failed with error code %d", result);
        exit(result);
    }

    // try to get versions
    #ifdef NXP_HW_SELF_TEST
    printf("nfcFactory_GetMwVersion:\t0x%x\n", nfcFactory_GetMwVersion());
    #endif
    printf("nfcManager_getFwVersion:\t0x%x\n\n", nfcManager_getFwVersion());

    // set up tag-callback
    nfcTagCallback_t cb_tag;
	cb_tag.onTagArrival = tagArrived;
	cb_tag.onTagDeparture = tagDeparted;
	nfcManager_registerTagCallback(&cb_tag);

	nfcManager_enableDiscovery(DEFAULT_NFA_TECH_MASK, 0, 0, 0);

    while(1) {
        usleep(MAIN_SLEEP);
    }
{'fraction_non_alphanumeric': 0.12326530612244897, 'fraction_numerical': 0.0163265306122449, 'mean_word_length': 4.0850622406639, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5018824', 'n_tokens_mistral': 961, 'n_tokens_neox': 913, 'n_words': 175}