ubuntu 12.04 source list

Tip 2014. 9. 29. 20:54

deb http://ftp.daum.net/ubuntu/ precise main restricted
deb-src http://ftp.daum.net/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ftp.daum.net/ubuntu/ precise-updates main restricted
deb-src http://ftp.daum.net/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ftp.daum.net/ubuntu/ precise universe
deb-src http://ftp.daum.net/ubuntu/ precise universe
deb http://ftp.daum.net/ubuntu/ precise-updates universe
deb-src http://ftp.daum.net/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ftp.daum.net/ubuntu/ precise multiverse
deb-src http://ftp.daum.net/ubuntu/ precise multiverse
deb http://ftp.daum.net/ubuntu/ precise-updates multiverse
deb-src http://ftp.daum.net/ubuntu/ precise-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://ftp.daum.net/ubuntu/ lucid-backports main restricted universe multiverse
# deb-src http://ftp.daum.net/ubuntu/ lucid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
deb http://archive.canonical.com/ precise partner

Posted by 깍수
,

- android/external/bluetooth/bluedroid/main/bte_conf.c


/*******************************************************************************
**
** Function        bte_load_conf
**
** Description     Read conf entry from p_path file one by one and call
**                 the corresponding config function
**
** Returns         None
**
*******************************************************************************/
void bte_load_conf(const char *p_path)
{
    FILE    *p_file;
    char    *p_name;
    char    *p_value;
    conf_entry_t    *p_entry;
    char    line[CONF_MAX_LINE_LEN+1]; /* add 1 for \0 char */
    BOOLEAN name_matched;

    ALOGI("Attempt to load stack conf from %s", p_path);

    if ((p_file = fopen(p_path, "r")) != NULL)
    {
        /* read line by line */
        while (fgets(line, CONF_MAX_LINE_LEN+1, p_file) != NULL)
        {
            if (line[0] == CONF_COMMENT)
                continue;

            p_name = strtok(line, CONF_DELIMITERS);

            if (NULL == p_name)
            {
                continue;
            }

            p_value = strtok(NULL, CONF_VALUES_DELIMITERS);

            if (NULL == p_value)
            {
                ALOGW("bte_load_conf: missing value for name: %s", p_name);
                continue;
            }

            name_matched = FALSE;
            p_entry = (conf_entry_t *)conf_table;

            while (p_entry->conf_entry != NULL)
            {
                if (strcmp(p_entry->conf_entry, (const char *)p_name) == 0)
                {
                    name_matched = TRUE;
                    if (p_entry->p_action != NULL)
                        p_entry->p_action(p_name, p_value);
                    break;
                }

                p_entry++;
            }

            if ((name_matched == FALSE) && (trace_conf_enabled == TRUE))
            {
                /* Check if this is a TRC config item */
                bte_trace_conf(p_name, p_value);
            }
        }

        fclose(p_file);
    }
    else
    {

 ALOGI( "bte_load_conf file >%s< not found", p_path);

    }
}



Posted by 깍수
,

1. gettimeofday

#include <sys/time.h>

#include <unistd.h>


int gettimeofday(struct timeval *tv, struct timezone *tz);

int settimeofday(const struct timeval *tv, const struct timezone *tz);


struct timeval {

    long tv_sec;

    long tv_usec;

}


struct timezone {

    long tz_minuteswest;

    long tz_dsttime;

}


ex) gettimeofday

#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>

int main( int argc, char ** argv )
{
    struct timeval tmstart, tmend;
    unsigned long elapsed;

    for(;;)
    {
        gettimeofday(&tmstart, NULL);
        usleep( 20000 );

        gettimeofday(&tmend, NULL);
        elapsed = (tmend.tv_sec - tmstart.tv_sec)*1000000 + tmend.tv_usec - tmstart.tv_usec;

        printf("elapsed time : %ld\n", elapsed);

       

        // 만약 시간을 뒤로 1시간 돌리고 싶다면

        tmend.tv_sec - 3600;

        settimeofday(&tmend, NULL);
    }

return 0;
}


2. clock_gettime

nanoseconds 까지 측정 가능한 함수 이다.

struct timespec {

    time_t tv_sec;     /* seconds */

    long tv_nsec;     /* nanoseconds */


ex) clock_gettime

컴파일시 -lrt 옵션을 넣어서 해당 library를 링크 시켜줘야 한다.

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

int main( int argc, char ** argv )
{

        const unsigned long long nano = 1000000000;
        unsigned long long t1, t2;

        struct timespec tm;

        for(;;)
        {

                clock_gettime( CLOCK_REALTIME, &tm );
                t1 = tm.tv_nsec + tm.tv_sec * nano;

                usleep( 20000 );

                clock_gettime( CLOCK_REALTIME, &tm );
                t2 = tm.tv_nsec + tm.tv_sec * nano;

                printf( "delay: %ld\n", ( t2 - t1 ) / 1000 );
        }

        return 0;

}


아래와 같이 함수를 만들어 사용하면 ms 시간을 얻어 편리하게 사용할 수 있을 것으로 보인다.

static long getTime(void)
{
    struct timeval  now;
    gettimeofday(&now, NULL);
    return (long)(now.tv_sec*1000 + now.tv_usec/1000);
}


static long _getTime(void)
{
    struct timespec now;
    clock_gettime(CLOCK_MONOTONIC, &now);
    return now.tv_sec*1000000 + now.tv_nsec/1000;
}



'Embedded Linux > Tip' 카테고리의 다른 글

dpkg를 이용한 package 정보를 알고 싶을 때  (0) 2014.08.14
[vim] Copy&Paste  (0) 2014.04.23
Target board에 대한 Toolchain 선택  (1) 2013.12.04
Posted by 깍수
,